fail_tuple_recurse.carbon 648 B

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