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
Don't eagerly materialize an initializing expression used as the object in a compound member access. (#4496)
Instead, wait until we know whether it is used as a value or reference
expression. This allows us to avoid materializing a temporary if it is
used as a value and the initializing representation holds a copy of a
value representation.
Copy file name to clipboardExpand all lines: toolchain/check/testdata/class/init_adapt.carbon
+5-7Lines changed: 5 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,7 @@ let b: AdaptC = a;
64
64
// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `AdaptC` to `C` [ImplicitAsConversionFailure]
65
65
// CHECK:STDERR: let c: C = b;
66
66
// CHECK:STDERR: ^~~~~~~~~~~~~
67
-
// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: note: type `<error>` does not implement interface `ImplicitAs` [MissingImplInMemberAccessNote]
67
+
// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: note: type `AdaptC` does not implement interface `ImplicitAs` [MissingImplInMemberAccessNote]
// CHECK:STDERR: fail_return_self_value.carbon:[[@LINE+13]]:25: error: invalid use of incomplete type `Class` [IncompleteTypeInConversion]
36
-
// CHECK:STDERR: fn F[self: Self]() -> self;
37
-
// CHECK:STDERR: ^~~~
38
-
// CHECK:STDERR: fail_return_self_value.carbon:[[@LINE-4]]:1: note: class is incomplete within its definition [ClassIncompleteWithinDefinition]
39
-
// CHECK:STDERR: class Class {
40
-
// CHECK:STDERR: ^~~~~~~~~~~~~
41
-
// CHECK:STDERR:
42
35
// CHECK:STDERR: fail_return_self_value.carbon:[[@LINE+6]]:25: error: cannot implicitly convert from `Class` to `type` [ImplicitAsConversionFailure]
43
36
// CHECK:STDERR: fn F[self: Self]() -> self;
44
37
// CHECK:STDERR: ^~~~
45
-
// CHECK:STDERR: fail_return_self_value.carbon:[[@LINE+3]]:25: note: type `<error>` does not implement interface `ImplicitAs` [MissingImplInMemberAccessNote]
38
+
// CHECK:STDERR: fail_return_self_value.carbon:[[@LINE+3]]:25: note: type `Class` does not implement interface `ImplicitAs` [MissingImplInMemberAccessNote]
0 commit comments