mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-22 15:52:38 +00:00
Both cases need a label for each level of struct and tuple type appearing in the impl query, because we can have an unbounded number of such levels with the types otherwise being the same. Prior to this, both added testcases exhibit unbounded recursion.
24 lines
756 B
Plaintext
24 lines
756 B
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
// AUTOUPDATE
|
|
// RUN: %{not} %{explorer-run}
|
|
// RUN: %{not} %{explorer-run-trace}
|
|
|
|
package ExplorerTest api;
|
|
|
|
interface Foo {}
|
|
|
|
impl forall [T:! type where {.a: .Self} is Foo] T as Foo {}
|
|
|
|
fn F[T:! Foo](x: T) {}
|
|
|
|
fn Main() -> i32 {
|
|
// CHECK:STDERR: COMPILATION ERROR: {{.*}}/explorer/testdata/impl_match/fail_struct_recurse.carbon:[[@LINE+3]]: impl matching recursively performed a more complex match using the same impl
|
|
// CHECK:STDERR: outer match: i32 as interface Foo
|
|
// CHECK:STDERR: inner match: {.a: i32} as interface Foo
|
|
F(0);
|
|
return 0;
|
|
}
|