[null-safety] enable null assertions for framework tests#64071
Merged
fluttergithubbot merged 1 commit intoflutter:masterfrom Aug 19, 2020
Merged
[null-safety] enable null assertions for framework tests#64071fluttergithubbot merged 1 commit intoflutter:masterfrom
fluttergithubbot merged 1 commit intoflutter:masterfrom
Conversation
jonahwilliams
commented
Aug 18, 2020
| TextSpan(), | ||
| ], | ||
| ), | ||
| null, |
Contributor
Author
There was a problem hiding this comment.
Seems like this code isn't correct, since TextSpan is not documented as accepting null children
jonahwilliams
commented
Aug 18, 2020
|
|
||
| @override | ||
| String get keyLabel => key; | ||
| String? get keyLabel => key; |
Contributor
Author
There was a problem hiding this comment.
supertype is nullable anyway
Hixie
reviewed
Aug 18, 2020
| ' "b"\n' | ||
| ' TextSpan:\n' | ||
| ' (empty)\n' | ||
| ' <null child>\n' |
Contributor
There was a problem hiding this comment.
is the code that generates this string also removed?
Contributor
Author
There was a problem hiding this comment.
No, but it does need an ignore on dead code:
https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/painting/text_span.dart#L372
Hixie
reviewed
Aug 18, 2020
| ' nulls in its child list.\n' | ||
| ' The full text in question was:\n' | ||
| ' TextSpan("foo bar")\n' | ||
| ); |
Contributor
There was a problem hiding this comment.
looks like the point of this test was to check that our null checking gave a pretty error message. What's the error message now? Is it still pretty?
Contributor
Author
There was a problem hiding this comment.
It depends:
- weak-mode, no null assertions - same error message
- weak-mode, null assertions - null assertion error when constructing the TextSpan. Depending on the context that might be easy to read or ugly
- strong-mode, static error can't be hit.
jmagman
added a commit
that referenced
this pull request
Aug 19, 2020
)" This reverts commit acdb909.
smadey
pushed a commit
to smadey/flutter
that referenced
this pull request
Aug 27, 2020
smadey
pushed a commit
to smadey/flutter
that referenced
this pull request
Aug 27, 2020
…tter#64071)" (flutter#64118) This reverts commit acdb909.
mingwandroid
pushed a commit
to mingwandroid/flutter
that referenced
this pull request
Sep 6, 2020
mingwandroid
pushed a commit
to mingwandroid/flutter
that referenced
this pull request
Sep 6, 2020
…tter#64071)" (flutter#64118) This reverts commit acdb909.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Run framework tests with --null-assertions enabled. #61042