Skip to content

Commit afc3467

Browse files
committed
typo
1 parent d0f8f7c commit afc3467

File tree

1 file changed

+18
-26
lines changed

1 file changed

+18
-26
lines changed

toolchain/check/testdata/facet/access.carbon

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,14 @@ fn F(U:! I where .X = .Self) {
210210
// member lookup, but can't call methods without `self`. See the
211211
// `compound_access_through_call_with_self_param.carbon` test for the former.
212212
//
213-
// CHECK:STDERR: fail_todo_compound_access_through_call.carbon:[[@LINE+4]]:6: error: value of type `<associated entity in I>` is not callable [CallToNonCallable]
214-
// CHECK:STDERR: u.(I.G());
215-
// CHECK:STDERR: ^~~~~
213+
// CHECK:STDERR: fail_todo_compound_access_through_call.carbon:[[@LINE+7]]:3: error: cannot implicitly convert non-type value of type `U` into type implementing `I` [ConversionFailureNonTypeToFacet]
214+
// CHECK:STDERR: u.(I.G)();
215+
// CHECK:STDERR: ^~~~~~~
216+
// CHECK:STDERR: fail_todo_compound_access_through_call.carbon:[[@LINE+4]]:3: note: type `U` does not implement interface `Core.ImplicitAs(I)` [MissingImplInMemberAccessNote]
217+
// CHECK:STDERR: u.(I.G)();
218+
// CHECK:STDERR: ^~~~~~~
216219
// CHECK:STDERR:
217-
u.(I.G());
220+
u.(I.G)();
218221

219222
// This is the same as the above, since G() returns a non-type value of type
220223
// `U`.
@@ -237,39 +240,28 @@ interface I {
237240
fn G[self: Self]() -> X;
238241
}
239242

240-
fn F(U:! I where .X = .Self) {
243+
fn F(U:! I where .X = .Self, v: U) {
241244
// Compound member lookup through a non-type value is possible for methods
242245
// which take a `self` parameter.
243246

244247
// TODO: This should all work.
245248

246-
// CHECK:STDERR: fail_todo_compound_access_through_call_with_self_param.carbon:[[@LINE+4]]:14: error: cannot access member of interface `I` in type `I where .(I.X) = .Self` that does not implement that interface [MissingImplInMemberAccess]
247-
// CHECK:STDERR: let u: U = U.(I.G)();
248-
// CHECK:STDERR: ^~~~~~~
249+
// CHECK:STDERR: fail_todo_compound_access_through_call_with_self_param.carbon:[[@LINE+7]]:14: error: cannot implicitly convert expression of type `.Self` to `U` [ConversionFailure]
250+
// CHECK:STDERR: let u: U = v.(I.G)();
251+
// CHECK:STDERR: ^~~~~~~~~
252+
// CHECK:STDERR: fail_todo_compound_access_through_call_with_self_param.carbon:[[@LINE+4]]:14: note: type `.Self` does not implement interface `Core.ImplicitAs(U)` [MissingImplInMemberAccessNote]
253+
// CHECK:STDERR: let u: U = v.(I.G)();
254+
// CHECK:STDERR: ^~~~~~~~~
249255
// CHECK:STDERR:
250-
let u: U = U.(I.G)();
256+
let u: U = v.(I.G)();
251257
// `u` is a non-type value. Can call methods with `self` through compound
252258
// member lookup, but can't call methods without `self`. See the
253259
// `compound_access_through_call.carbon` test for the latter.
254-
// CHECK:STDERR: fail_todo_compound_access_through_call_with_self_param.carbon:[[@LINE+4]]:6: error: member name `G2` not found in `I` [MemberNameNotFoundInInstScope]
255-
// CHECK:STDERR: u.(I.G2());
256-
// CHECK:STDERR: ^~~~
257-
// CHECK:STDERR:
258-
u.(I.G2());
260+
u.(I.G)();
259261

260262
// This is the same as the above, since G() returns a non-type value of type
261-
// `U`.
262-
//
263-
// This works because G2 has a `self` parameter.
264-
// CHECK:STDERR: fail_todo_compound_access_through_call_with_self_param.carbon:[[@LINE+8]]:3: error: cannot access member of interface `I` in type `I where .(I.X) = .Self` that does not implement that interface [MissingImplInMemberAccess]
265-
// CHECK:STDERR: U.(I.G)().(I.G2)();
266-
// CHECK:STDERR: ^~~~~~~
267-
// CHECK:STDERR:
268-
// CHECK:STDERR: fail_todo_compound_access_through_call_with_self_param.carbon:[[@LINE+4]]:14: error: member name `G2` not found in `I` [MemberNameNotFoundInInstScope]
269-
// CHECK:STDERR: U.(I.G)().(I.G2)();
270-
// CHECK:STDERR: ^~~~
271-
// CHECK:STDERR:
272-
U.(I.G)().(I.G2)();
263+
// `U`. This works because G has a `self` parameter.
264+
v.(I.G)().(I.G)();
273265
}
274266

275267
// --- fail_non_const_associated.carbon

0 commit comments

Comments
 (0)