fail_wrong_variable_substituation.carbon 475 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. // CHECK:STDERR: COMPILATION ERROR: fail_wrong_variable_substituation.carbon:[[@LINE+1]]: value of generic binding T is not known
  10. fn Get[T:! ()](n: T) -> i32 { return 2; }
  11. fn Main() -> i32 {
  12. var x : X = {};
  13. Get(x);
  14. return 0;
  15. }