call_at_compile_time.carbon 424 B

12345678910111213141516171819202122
  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 ExplorerTest api;
  7. interface X { fn F(); }
  8. impl i32 as X { fn F() {} }
  9. fn G[T:! X](v: T) -> type {
  10. v.F();
  11. return i32;
  12. }
  13. fn Main() -> i32 {
  14. var v: G(0) = 0;
  15. return v;
  16. }
  17. // CHECK:STDOUT: result: 0