fail_three_step_recurse.carbon 777 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 A {}
  8. interface B {}
  9. interface C {}
  10. impl forall [T:! type where .Self* impls A] T as B {}
  11. impl forall [T:! type where .Self* impls B] T as C {}
  12. impl forall [T:! type where .Self* impls C] T as A {}
  13. fn F[T:! A](x: T) {}
  14. fn Main() -> i32 {
  15. // CHECK:STDERR: COMPILATION ERROR: fail_three_step_recurse.carbon:[[@LINE+3]]: impl matching recursively performed a more complex match using the same impl
  16. // CHECK:STDERR: outer match: i32 as interface A
  17. // CHECK:STDERR: inner match: i32*** as interface A
  18. F(0);
  19. return 0;
  20. }