fail_multiple_deduction.carbon 790 B

12345678910111213141516171819202122232425
  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. // RUN: %{not} %{explorer-run}
  7. // RUN: %{not} %{explorer-run-trace}
  8. package ExplorerTest api;
  9. interface HasThreeTypes {
  10. let A:! Type;
  11. let B:! Type;
  12. let C:! Type;
  13. fn Make[me: Self]() -> (A, B, C);
  14. }
  15. fn F[T:! Type](x: (T, T, T));
  16. fn G[X:! HasThreeTypes where .A == .B and .B == .C and .C == .A](x: X) {
  17. // CHECK:STDERR: COMPILATION ERROR: {{.*}}/explorer/testdata/assoc_const/fail_multiple_deduction.carbon:[[@LINE+3]]: deduced multiple different values for T:! Type:
  18. // CHECK:STDERR: (X).A
  19. // CHECK:STDERR: (X).B
  20. F(x.Make());
  21. }
  22. fn Main() -> i32 { return 0; }