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