-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Sound null safety for framework and flutter_test #68642
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
jonahwilliams
left a comment
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.
Besides layer example LGTM
ec243ce to
1e64a2b
Compare
jonahwilliams
left a comment
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 if LG to CI
|
The failing |
jonahwilliams
left a comment
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
4513adf to
133a5c3
Compare
|
The last few widget inspector failures need: Additionally you should only pass --sound-null-safety to the framework and flutter_test tests. |
|
That works too :) |
|
The failing internal tests are legit, but we can fix the code there there after merging this PR -- Some user code expects the returned value to be a non-nullable type for the result of |
shihaohong
left a comment
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.
The null-safety code changes themselves LGTM, just some questions about example/layers since I'm less familiar and might've missed some context.
| await _runFlutterTest(path.join(flutterRoot, 'dev', 'tools', 'vitool'), tableData: bigqueryApi?.tabledata); | ||
| await _runFlutterTest(path.join(flutterRoot, 'examples', 'hello_world'), tableData: bigqueryApi?.tabledata); | ||
| await _runFlutterTest(path.join(flutterRoot, 'examples', 'layers'), tableData: bigqueryApi?.tabledata); | ||
| await _runFlutterTest(path.join(flutterRoot, 'examples', 'layers'), tableData: bigqueryApi?.tabledata, options: mixedModeNullSafetyOptions); |
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.
I might've missed the context, but what about the layer example that's giving it mixedModeNullSafetyOptions vs the rest of the tests?
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.
Some files from this example are imported from the framework tests, so I've only migrated those files. The remaining files are still unmigrated, so the tests for the examples themselves need to run in mixed mode.
| // found in the LICENSE file. | ||
|
|
||
| // @dart = 2.8 | ||
| // @dart = 2.10 |
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.
Does this turn on null-safety, but in mixed mode for examples/layers?
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.
This allows us to use null safety syntax in this file (i.e. the ! and ?).
|
|
||
| testWidgets('Return value from pop is correct', (WidgetTester tester) async { | ||
| late Future<Object> result; | ||
| late Future<Object?> result; |
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.
The internal test failure is similar to what caused this test to fail
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.
It's slightly different, fix is in cl/338282385.
|
Submitting, google3 is fixed with cl/338282385. |
This fixes all issues expect the test failures from
test/widgets/widget_inspector_test.dart, which are resolved by @jacob314 in #68661.Fixes #68562