-
Notifications
You must be signed in to change notification settings - Fork 227
Make TOP_MERGE resolve to Object?
#904
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
Conversation
- `NNBD_TOP_MERGE(dynamic, dynamic) = dynamic` | ||
- `NNBD_TOP_MERGE(void, void) = void` | ||
- `NNBD_TOP_MERGE(Object?, void) = void` | ||
- `NNBD_TOP_MERGE(Object?, void) = Object?` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You generally use precedence, so would it be enough to write
NNBD_TOP_MERGE(x, y) = Object?
, x, y in {void, Object?, dynamic}
(perhaps with an "otherwise" attached, or anx != y
).
Not necessary, just perhaps easier to understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I don't see any reason to use a different style that the "list all cases" style we have now.
Tests for member signatures out for review here |
Tests for member signature resolution as specified in this change: dart-lang/language#904 Change-Id: I7ee81dd1927b8f9419082f9bd2cbec14f0a5c0f0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142802 Reviewed-by: Erik Ernst <eernst@google.com>
This changes the specification of NNBD_TOP_MERGE to resolve any conflicting top types to
Object?
, per discussion here.Initial set of tests here, more to follow.
[Edit: more tests here]
cc @eernstg @munificent @lrhn