param_interface_in_impl.carbon 547 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. package ExplorerTest api;
  7. interface Similar(T:! type) {}
  8. impl forall [T:! type] T as Similar(T) {}
  9. impl forall [T:! type] i32 as Similar(T) {}
  10. fn CheckSimilar[T:! type, U:! Similar(T)](a: T, b: U) {}
  11. fn Main() -> i32 {
  12. let n: i32 = 0;
  13. CheckSimilar(true, false);
  14. CheckSimilar(true, n);
  15. return 0;
  16. }
  17. // CHECK:STDOUT: result: 0