You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// CHECK:STDERR: fail_todo_implied_constraint_on_self.carbon:[[@LINE+7]]:26: error: cannot convert type `.Self` that implements `Z` into type implementing `Z where .(Z.Z1) = ()` [ConversionFailureFacetToFacet]
// CHECK:STDERR: fail_todo_implied_constraint_on_self.carbon:[[@LINE+7]]:38: error: cannot convert type `.Self` that implements `Z` into type implementing `Z where .(Z.Z1) = ()` [ConversionFailureFacetToFacet]
47
+
// CHECK:STDERR: impl D as Z where .Z1 = () and .Z2 = C(.Self) {}
// CHECK:STDERR: fail_todo_implied_constraint_on_associated_constant.carbon:[[@LINE+7]]:26: error: cannot convert type `.(Z.Z1)` into type implementing `Tuple` [ConversionFailureTypeToFacet]
// Implied: .Z1 == (), but this is also explicitly required for J1.
29
104
let J1:! (Z where .Z1= ()) where .Z2=C(.Self);
30
105
}
31
106
107
+
fnF(T:! J) {}
108
+
109
+
class D;
110
+
// Satisfies the implied constraint in J.J1.
111
+
// CHECK:STDERR: fail_todo_nested_constraint_visible_in_type_parameter.carbon:[[@LINE+7]]:38: error: cannot convert type `.Self` that implements `Z` into type implementing `Z where .(Z.Z1) = ()` [ConversionFailureFacetToFacet]
112
+
// CHECK:STDERR: impl D as Z where .Z1 = () and .Z2 = C(.Self) {}
// CHECK:STDERR: fail_todo_nested_constraint_visible_in_type_parameter.carbon:[[@LINE+4]]:24: error: cannot convert type `D` into type implementing `Z where .(Z.Z1) = () and .(Z.Z2) = C(.Self)` [ConversionFailureTypeToFacet]
// Implied: .Z1 == (), but this is also explicitly required for J1.
139
+
// CHECK:STDERR: fail_todo_outer_nested_constraint_visible_in_type_parameter.carbon:[[@LINE+7]]:27: error: cannot convert type `.Self` that implements `Z` into type implementing `Z where .(Z.Z1) = ()` [ConversionFailureFacetToFacet]
140
+
// CHECK:STDERR: let J1:! (Z where .Z2 = C(.Self)) where .Z1 = ();
// CHECK:STDERR: fail_todo_outer_nested_constraint_visible_in_type_parameter.carbon:[[@LINE+7]]:38: error: cannot convert type `.Self` that implements `Z` into type implementing `Z where .(Z.Z1) = ()` [ConversionFailureFacetToFacet]
154
+
// CHECK:STDERR: impl D as Z where .Z1 = () and .Z2 = C(.Self) {}
// TODO: Should this pass? Or do we need a `where` between .Z1 and .Z2 to make
43
-
// .Z1's value visible to .Z2?
44
-
// See https://github.com/carbon-language/carbon-lang/issues/5884.
45
175
interfaceJ {
176
+
// Implied: .Z1 == (), but this is also explicitly required for J1.
46
177
// CHECK:STDERR: fail_todo_earlier_constraint_visible_in_type_parameter.carbon:[[@LINE+7]]:39: error: cannot convert type `.Self` that implements `Z` into type implementing `Z where .(Z.Z1) = ()` [ConversionFailureFacetToFacet]
47
178
// CHECK:STDERR: let J1:! Z where .Z1 = () and .Z2 = C(.Self);
// CHECK:STDERR: fail_todo_earlier_constraint_visible_in_type_parameter.carbon:[[@LINE+7]]:38: error: cannot convert type `.Self` that implements `Z` into type implementing `Z where .(Z.Z1) = ()` [ConversionFailureFacetToFacet]
192
+
// CHECK:STDERR: impl D as Z where .Z1 = () and .Z2 = C(.Self) {}
// TODO: Should this pass? Or do we need a `where` between .Z1 and .Z2 to make
67
-
// .Z1's value visible to .Z2?
68
-
// See https://github.com/carbon-language/carbon-lang/issues/5884.
69
213
interfaceJ {
214
+
// Implied: .Z1 == (), but this is also explicitly required for J1.
70
215
// CHECK:STDERR: fail_todo_later_constraint_visible_in_type_parameter.carbon:[[@LINE+7]]:26: error: cannot convert type `.Self` that implements `Z` into type implementing `Z where .(Z.Z1) = ()` [ConversionFailureFacetToFacet]
71
216
// CHECK:STDERR: let J1:! Z where .Z2 = C(.Self) and .Z1 = ();
// CHECK:STDERR: fail_todo_later_constraint_visible_in_type_parameter.carbon:[[@LINE+7]]:38: error: cannot convert type `.Self` that implements `Z` into type implementing `Z where .(Z.Z1) = ()` [ConversionFailureFacetToFacet]
230
+
// CHECK:STDERR: impl D as Z where .Z1 = () and .Z2 = C(.Self) {}
// Implied: .Z1 == (), but this is also explicitly required for J1.
255
+
// CHECK:STDERR: fail_todo_early_rewrite_applied.carbon:[[@LINE+7]]:39: error: cannot convert type `.(Z.Z1)` into type implementing `Tuple` [ConversionFailureTypeToFacet]
256
+
// CHECK:STDERR: let J1:! Z where .Z1 = () and .Z2 = C(.Z1);
// Implied: .Z1 == (), but this is also explicitly required for J1.
292
+
// CHECK:STDERR: fail_todo_early_rewrite_applied_extra_indirection.carbon:[[@LINE+7]]:59: error: cannot convert type `.(Y.Y1).(Z.Z1)` into type implementing `Tuple` [ConversionFailureTypeToFacet]
293
+
// CHECK:STDERR: let J1:! Y & Z where .Y1 = .Self and .Z1 = () and .Z2 = C(.Y1.Z1);
// TODO: Should this pass? Or do we need a `where` between .Z2 and .Z3 to make
98
-
// .Z2's value visible to .Z3?
99
-
// See https://github.com/carbon-language/carbon-lang/issues/5884.
100
329
interfaceJ {
101
-
// CHECK:STDERR: fail_todo_resolved_constraint_visible_in_type_parameter.carbon:[[@LINE+7]]:80: error: cannot convert type `.(Z.Z2)` into type implementing `Tuple` [ConversionFailureTypeToFacet]
102
-
// CHECK:STDERR: let J1:! (Z & Y where .Y1 = ()) where .Z1 = .Self and .Z2 = .Z1.Y1 and .Z3 = C(.Z2);
// Implied: .Y1 impls Tuple, but this is also explicitly required for J1.
331
+
// CHECK:STDERR: fail_todo_resolved_constraint_visible_in_type_parameter.carbon:[[@LINE+7]]:76: error: cannot convert type `.(Z.Z2)` into type implementing `Tuple` [ConversionFailureTypeToFacet]
332
+
// CHECK:STDERR: let J1:! Z & Y where .Y1 = () and .Z1 = .Self and .Z2 = .Z1.Y1 and .Z3 = C(.Z2);
let J1:! (Z & Y where .Y1= ()) where .Z1= .Self and .Z2= .Z1.Y1 and .Z3=C(.Z2);
338
+
let J1:! Z & Y where .Y1= () and .Z1= .Self and .Z2= .Z1.Y1 and .Z3=C(.Z2);
339
+
}
340
+
341
+
fnF(T:! J) {}
342
+
343
+
class D;
344
+
// Satisfies the implied constraint in J.J1.
345
+
impl D asY where .Y1= () {}
346
+
// CHECK:STDERR: fail_todo_resolved_constraint_visible_in_type_parameter.carbon:[[@LINE+4]]:25: error: cannot convert type `.Self` that implements `Z` into type implementing `Y` [ConversionFailureFacetToFacet]
347
+
// CHECK:STDERR: impl D as Z where .Z1 = .Self and .Z2 = () and .Z3 = C(()) {}
348
+
// CHECK:STDERR: ^~~~~
349
+
// CHECK:STDERR:
350
+
impl D asZ where .Z1= .Self and .Z2= () and .Z3=C(()) {}
Copy file name to clipboardExpand all lines: toolchain/check/testdata/impl/impl_assoc_const.carbon
+43Lines changed: 43 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -344,6 +344,49 @@ interface M { let X:! type; }
344
344
345
345
impl () asM where .X= (M where .X= (M where .X= {})) {}
346
346
347
+
// --- fail_todo_period_self_impl_lookup.carbon
348
+
library "[[@TEST_NAME]]";
349
+
350
+
interfaceY {}
351
+
interfaceZ {
352
+
let Z1:! Y;
353
+
}
354
+
355
+
class C;
356
+
impl C asY {}
357
+
// CHECK:STDERR: fail_todo_period_self_impl_lookup.carbon:[[@LINE+4]]:25: error: cannot convert type `.Self` that implements `Z` into type implementing `Y` [ConversionFailureFacetToFacet]
// CHECK:STDERR: fail_todo_period_self_compared_with_concrete_self.carbon:[[@LINE+4]]:24: error: cannot convert type `.Self` that implements `Z` into type implementing `Y` [ConversionFailureFacetToFacet]
376
+
// CHECK:STDERR: fn F(T:! Z where .Z1 = .Self) {}
377
+
// CHECK:STDERR: ^~~~~
378
+
// CHECK:STDERR:
379
+
fnF(T:! Z where .Z1= .Self) {}
380
+
fnG() {
381
+
F(C);
382
+
383
+
// CHECK:STDERR: fail_todo_period_self_compared_with_concrete_self.carbon:[[@LINE+4]]:23: error: cannot convert type `.Self` that implements `Z` into type implementing `Y` [ConversionFailureFacetToFacet]
0 commit comments