-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong expectation in normalization test. #42143
Comments
Running the test The second issue occurs at line 191: The third issue occurs at line 191:
Although the source looks like this
the kernel file looks like this
which explains the error reported by the VM. The nullability of the type parameters is not correct in the kernel file. Is this a known CFE issue? |
I'm seeing the same errors from my work in progress change in DDC. |
Changed to the issue to a front-end issue for the CFE problem. Will change back if there is more work needed on the test itself after the CFE part has been fixed. |
In order to normalize 'X extends Never' to 'Never' (and 'X? extends Never' to 'Null'), the VM has to instantiate the bounds of function type parameters. Instantiating these bounds lazily is not easily feasible, as the instantiators are not kept around after instantiating types. Note that the normalization tests do not yet pass due to test issues and CFE issues, see #42143 Change-Id: I9ed6fcb9d7a11a4adbe514757ad9ac6ff7818981 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147281 Commit-Queue: Régis Crelier <regis@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reopening. The CFE issue has been fixed but none of the mentioned tests were fixed by it so some work seems to be needed on the backend side. |
I think that the remaining failures are due to wrong expectations rather than to backend problems. I sent a CL fixing the test: https://dart-review.googlesource.com/c/sdk/+/151440 @johnniwinther The CFE issue #41952 previously mentioned in a comment in the test seems to have been fixed and should probably be closed. |
This fixes issue #42143 Change-Id: I11df42728f74e85071566b355d1a3bbba4182aea Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151440 Reviewed-by: Leaf Petersen <leafp@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Régis Crelier <regis@google.com>
A new normalization test introduced in this CL does not include requirements to run either in weak or strong mode, therefore, it runs in both modes.
On the VM (a non yet committed version including fixes), this test fails in both modes due to wrong expectations.
Weak mode:
The bounds
Future<Never>?
andFuture<Never>
are mutual subtypes, since their nullability is ignored in weak mode.In strong mode:
Here also, the bounds
FutureOr<Future<Object>>
andFuture<Object>
are mutual subtypes.It is easy to see that
Future<Object>
is a subtype ofFutureOr<Future<Object>>
.The reverse is less obvious. We have to show that
Future<Future<Object>>
is a subtype ofFuture<Object>
and it is, becauseFuture<Object>
is a subtype ofObject
.The text was updated successfully, but these errors were encountered: