Skip to content

Commit 95b5cce

Browse files
authored
Add tests that show .X and .Self.X are treated the same on the RHS of a rewrite constraint (#6056)
1 parent 5e3bb52 commit 95b5cce

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

toolchain/check/testdata/facet/facet_assoc_const.carbon

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,26 @@ interface N {
451451
// CHECK:STDERR:
452452
fn F(T:! N where .Y = {.a = {}} and .Y = {.a = ()}) {}
453453

454+
// --- self_repeated_explicitly.carbon
455+
library "[[@TEST_NAME]]";
456+
457+
interface N {
458+
let Y1:! type;
459+
let Y2:! type;
460+
}
461+
462+
fn F(T:! N where .Y2 = .Y1 and .Y2 = .Self.Y1) { }
463+
464+
// --- self_repeated_explicitly_with_value.carbon
465+
library "[[@TEST_NAME]]";
466+
467+
interface N {
468+
let Y1:! type;
469+
let Y2:! type;
470+
}
471+
472+
fn F(T:! N where .Y1 = () and .Y2 = .Y1 and .Y2 = .Self.Y1) { }
473+
454474
// --- fail_todo_cycle_through_self_reference.carbon
455475
library "[[@TEST_NAME]]";
456476

0 commit comments

Comments
 (0)