fail_wrong_variable_substituation.carbon 536 B

12345678910111213141516171819
  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. package Foo api;
  7. class X{
  8. }
  9. fn Get[T:! ()](n: T) -> i32 { return 2; }
  10. fn Main() -> i32 {
  11. var x : X = {};
  12. // CHECK:STDERR: COMPILATION ERROR: explorer/testdata/generic_function/fail_wrong_variable_substituation.carbon:[[@LINE+1]]: cannot convert deduced value class X for T to parameter type ()
  13. Get(x);
  14. return 0;
  15. }