-
Notifications
You must be signed in to change notification settings - Fork 75
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
Migrate debugging/inspector.dart to null safety #1684
Conversation
@@ -108,6 +108,6 @@ abstract class Domain { | |||
late AppInspectorInterface inspector; | |||
} | |||
|
|||
void throwInvalidParam(String method, String message) { | |||
Never throwInvalidParam(String method, String message) { |
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.
Mistake?
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.
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)
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.
TIL, thanks!
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 with one small change
Migrate debugging/inspector.dart to null safety. Add tests for inspector throwing ChromeDebugException on evaluation errors.
Towards: #1327