fail_instantiate_non_generic.carbon 674 B

1234567891011121314151617181920212223
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // AUTOUPDATE
  6. // RUN: %{not} %{explorer-run}
  7. // RUN: %{not} %{explorer-run-trace}
  8. package ExplorerTest api;
  9. class Point {
  10. fn Origin() -> Point {
  11. return {.x = 0, .y = 0};
  12. }
  13. var x: i32;
  14. var y: i32;
  15. }
  16. fn Main() -> i32 {
  17. // CHECK:STDERR: COMPILATION ERROR: {{.*}}/explorer/testdata/generic_class/fail_instantiate_non_generic.carbon:[[@LINE+1]]: in call `Point(i32)`, expected callee to be a function, found `Type`
  18. var p: Point(i32) = Point.Origin();
  19. return 0;
  20. }