fail_generic_class_arg.carbon 700 B

123456789101112131415161718192021222324
  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(T:! Type) {
  10. fn Create(x: T, y: T) -> Point(T) {
  11. return {.x = x, .y = y};
  12. }
  13. var x: T;
  14. var y: T;
  15. }
  16. fn Main() -> i32 {
  17. // CHECK:STDERR: COMPILATION ERROR: {{.*}}/explorer/testdata/generic_class/fail_generic_class_arg.carbon:[[@LINE+1]]: wrong number of arguments in function call, expected 1 but got 2
  18. var p: Point(i32) = Point(i32, i32).Create(0, 1);
  19. return p.x;
  20. }