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_convert_from_period_self_to_full_facet_value.carbon:[[@LINE+4]]:3: error: cannot convert type `U` that implements `I where .(I.I1) = .Self` into type implementing `I where .(I.I1) = U` [ConversionFailureFacetToFacet]
92
+
// CHECK:STDERR: U as (I where .I1 = U);
93
+
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
94
+
// CHECK:STDERR:
95
+
U as (I where .I1= U);
96
+
// CHECK:STDERR: fail_todo_convert_from_period_self_to_full_facet_value.carbon:[[@LINE+4]]:3: error: cannot convert type `U` into type implementing `I where .(I.I1) = U` [ConversionFailureTypeToFacet]
97
+
// CHECK:STDERR: (U as type) as (I where .I1 = U);
98
+
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99
+
// CHECK:STDERR:
100
+
(U astype) as (I where .I1= U);
101
+
}
102
+
83
103
// --- fail_todo_access_through_call.carbon
84
104
library "[[@TEST_NAME]]";
85
105
@@ -88,25 +108,49 @@ interface I {
88
108
fnG() -> X;
89
109
}
90
110
111
+
fnF2[U:! I](T: U) {}
112
+
fnF3[U:! I where .X= .Self](T: U) {}
113
+
91
114
fnF(U:! I where .X= .Self) {
115
+
// The returned value of `G` type `U` which has access to the methods of `I`.
116
+
//
117
+
// TODO: This works but a chained third call doesn't.
92
118
U.G().G();
93
-
94
-
// TODO: This should typecheck.
95
119
// - The first `.` is on a NameRef of type FacetType for `I where .X = .Self`.
96
120
// - This finds `G` through the FacetType.
97
121
// - The second `.` is on a Call of type FacetAccessType into `BindSymbolicName` with type FacetType for `I`.
98
122
// - This finds `G` through the FacetType (impl lookup strips off FacetAccessType).
99
-
// - The second `.` is on a Call of type FacetAccessType into `ImplWitnessAccess` of `I.X` into `LookupImplWitness`, which has type `type`
123
+
// - The third `.` is on a Call of type FacetAccessType into `ImplWitnessAccess` of `I.X` into `LookupImplWitness`, which has type `type`
100
124
// - Can't make calls on an `ImplWitnessAccess`.
101
-
//
125
+
// - We could expect that the constant value of the `ImplWitnessAccess` would
126
+
// be the same type that we got for the second lookup.
102
127
// CHECK:STDERR: fail_todo_access_through_call.carbon:[[@LINE+4]]:3: error: type `.(I.X)` does not support qualified expressions [QualifiedExprUnsupported]
103
128
// CHECK:STDERR: U.G().G().G();
104
129
// CHECK:STDERR: ^~~~~~~~~~~
105
130
// CHECK:STDERR:
106
131
U.G().G().G();
132
+
// CHECK:STDERR: fail_todo_access_through_call.carbon:[[@LINE+4]]:3: error: type `.(I.X)` does not support qualified expressions [QualifiedExprUnsupported]
133
+
// CHECK:STDERR: (U as type).G().G().G();
134
+
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
135
+
// CHECK:STDERR:
136
+
(U astype).G().G().G();
137
+
138
+
// The returned value of type `U` can be used as a value of type `U`.
139
+
// CHECK:STDERR: fail_todo_access_through_call.carbon:[[@LINE+4]]:6: error: type `.(I.X)` does not support qualified expressions [QualifiedExprUnsupported]
140
+
// CHECK:STDERR: F2(U.G().G().G());
141
+
// CHECK:STDERR: ^~~~~~~~~~~
142
+
// CHECK:STDERR:
143
+
F2(U.G().G().G());
144
+
145
+
// TODO: The constraints in the type `U` are preserved.
146
+
// CHECK:STDERR: fail_todo_access_through_call.carbon:[[@LINE+4]]:6: error: type `.(I.X)` does not support qualified expressions [QualifiedExprUnsupported]
// CHECK:STDERR: fail_todo_access_through_call_converts_is_a_type.carbon:[[@LINE+7]]:3: error: cannot convert non-type value of type `.Self` to `type` with `as` [ConversionFailureNonTypeToFacet]
123
-
// CHECK:STDERR: U.G() as type;
124
-
// CHECK:STDERR: ^~~~~~~~~~~~~
125
-
// CHECK:STDERR: fail_todo_access_through_call_converts_is_a_type.carbon:[[@LINE+4]]:3: note: type `.Self` does not implement interface `Core.As(type)` [MissingImplInMemberAccessNote]
126
-
// CHECK:STDERR: U.G() as type;
127
-
// CHECK:STDERR: ^~~~~~~~~~~~~
167
+
// CHECK:STDERR: fail_todo_compound_access_through_call.carbon:[[@LINE+7]]:3: error: cannot implicitly convert non-type value of type `.Self` into type implementing `I` [ConversionFailureNonTypeToFacet]
168
+
// CHECK:STDERR: U.(I.G)().(I.G)().(I.G)();
169
+
// CHECK:STDERR: ^~~~~~~~~~~~~~~
170
+
// CHECK:STDERR: fail_todo_compound_access_through_call.carbon:[[@LINE+4]]:3: note: type `.Self` does not implement interface `Core.ImplicitAs(I)` [MissingImplInMemberAccessNote]
0 commit comments