fail_self_recurse_with_match.carbon 775 B

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