Skip to content
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

Migrate debugging/inspector.dart to null safety #1684

Merged

Conversation

annagrin
Copy link
Contributor

@annagrin annagrin commented Jul 13, 2022

Migrate debugging/inspector.dart to null safety. Add tests for inspector throwing ChromeDebugException on evaluation errors.

Towards: #1327

@annagrin annagrin requested a review from elliette July 13, 2022 19:25
@@ -108,6 +108,6 @@ abstract class Domain {
late AppInspectorInterface inspector;
}

void throwInvalidParam(String method, String message) {
Never throwInvalidParam(String method, String message) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Mistake?

Copy link
Contributor Author

@annagrin annagrin Jul 14, 2022

Choose a reason for hiding this comment

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

Never is a "bottom" type, it tells the compiler that this function never returns, so it can do null inference after it used, for example:

if (x ==null) {
 throwInvalidParam();
}
// x is not null here

here are more details: https://dart.dev/null-safety/understanding-null-safety (top and bottom, unreachable code sections)

Copy link
Contributor

Choose a reason for hiding this comment

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

TIL, thanks!

Copy link
Contributor

@elliette elliette left a comment

Choose a reason for hiding this comment

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

LGTM with one small change

@annagrin annagrin merged commit b697974 into dart-lang:master Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants