Skip to content

Conversation

@jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented Aug 18, 2020

Description

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

@flutter-dashboard flutter-dashboard bot added framework flutter/packages/flutter repository. See also f: labels. c: contributor-productivity Team-specific productivity, code health, technical debt. labels Aug 18, 2020
TextSpan(),
],
),
null,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this code isn't correct, since TextSpan is not documented as accepting null children


@override
String get keyLabel => key;
String? get keyLabel => key;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

supertype is nullable anyway

Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

' "b"\n'
' TextSpan:\n'
' (empty)\n'
' <null child>\n'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the code that generates this string also removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

' nulls in its child list.\n'
' The full text in question was:\n'
' TextSpan("foo bar")\n'
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends:

  1. weak-mode, no null assertions - same error message
  2. weak-mode, null assertions - null assertion error when constructing the TextSpan. Depending on the context that might be easy to read or ugly
  3. strong-mode, static error can't be hit.

@fluttergithubbot fluttergithubbot merged commit acdb909 into flutter:master Aug 19, 2020
jmagman added a commit that referenced this pull request Aug 19, 2020
jmagman added a commit that referenced this pull request Aug 19, 2020
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
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
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

c: contributor-productivity Team-specific productivity, code health, technical debt. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants