ac4a09688df096b7967d347059fe514b011a0c5e 492 B

123456789101112131415161718192021
  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. // CHECK:STDOUT: result: 5
  7. package ExplorerTest;
  8. interface HasTypeAndValue {
  9. let T:! type;
  10. let V:! T;
  11. }
  12. fn F(X:! HasTypeAndValue where .T = i32 and .V = 5) -> i32 { return X.V; }
  13. impl i32 as HasTypeAndValue where .T = i32 and .V = 5 {}
  14. fn Main() -> i32 {
  15. return F(i32);
  16. }