-
Notifications
You must be signed in to change notification settings - Fork 213
Clarify boolean conditional evaluation #917
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
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 w/nit.
and hence must be implicitly downcast to `bool`, after which no further check is | ||
required. | ||
|
||
In mixed mode (weak mode evaluation) Dart, values of type `Never` and `bool` may |
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.
In mixed mode (weak mode evaluation) Dart
It doesn't matter if it is mixed or not. Maybe simply 'In weak checking mode...'
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.
Done.
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.
Thanks for the clarification.
Landing this. I'm working on tests to accompany, I will file issues for any failures. |
Tests out for review here: https://dart-review.googlesource.com/c/sdk/+/142782 |
Tests for the null safety spec clarification landed in dart-lang/language#917 . Change-Id: Ieafe5315c31919c01ff816a26d29fa0d1cbc8c9a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142782 Reviewed-by: Erik Ernst <[email protected]>
Partially reverts https://dart-review.googlesource.com/c/sdk/+/139402 but continues to throw a TypeError when running in strong mode. The breaking change to boolean conversions was not back-ported so we are still going to throw an AssertionError in weak mode. Updated Spec: dart-lang/language#917 Fixes: #41278 Change-Id: Ib50e9ab367f4a0c0f9f10c3e0fa4ec890ff9c2ae Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143007 Reviewed-by: Sigmund Cherem <[email protected]> Reviewed-by: Mark Zhou <[email protected]> Commit-Queue: Nicholas Shahan <[email protected]>
Clarify the behavior of boolean conditional expressions in strong and weak mode.
cc @nshahan @sigmundch @rakudrama @alexmarkov @lrhn @eernstg @munificent