fail_missing_rewrite.carbon 725 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. package ExplorerTest api;
  7. interface Container {
  8. let Element:! type;
  9. fn Front[self: Self]() -> Element;
  10. }
  11. fn A[T:! Container where .Element = i32](x: T) -> T.Element {
  12. return x.Front();
  13. }
  14. fn B[T:! Container](x: T) -> i32 {
  15. // CHECK:STDERR: COMPILATION ERROR: explorer/testdata/assoc_const/fail_missing_rewrite.carbon:[[@LINE+1]]: constraint requires that (T).(Container.Element) (with value (T).(Container.Element)) == i32, which is not known to be true
  16. return A(x);
  17. }
  18. fn Main() -> i32 {
  19. return 0;
  20. }