fail_multiple_deduction.carbon 749 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 HasThreeTypes {
  8. let A:! type;
  9. let B:! type;
  10. let C:! type;
  11. fn Make[self: Self]() -> (A, B, C);
  12. }
  13. fn F[T:! type](x: (T, T, T));
  14. fn G[X:! HasThreeTypes where .A == .B and .B == .C and .C == .A](x: X) {
  15. // CHECK:STDERR: COMPILATION ERROR: explorer/testdata/assoc_const/fail_multiple_deduction.carbon:[[@LINE+3]]: deduced multiple different values for T:! type:
  16. // CHECK:STDERR: (X).(HasThreeTypes.A)
  17. // CHECK:STDERR: (X).(HasThreeTypes.B)
  18. F(x.Make());
  19. }
  20. fn Main() -> i32 { return 0; }