-
-
Notifications
You must be signed in to change notification settings - Fork 665
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
Null safety strictness levels #7745
Comments
What about |
I don't want to support mixed modes ) |
The ability to set it per package doesn't count as "mixed modes"? |
Any technical reason for that? If we configure this per-field anyway I don't see much of a problem with it. We could have this:
|
I'm scared that in the end I'll have to support different modes for different expressions in the single method body :) |
@Simn Hm, supporting both ("null safety off" also sounds a bit better in my head than "null safety false") |
That can be like |
But then again, if it's supported per package/field, then why not per expression? ) |
I guess we don't need the bools. I treated it like it's the existing way to configure, but I suppose we are still free to change it. |
Something like
For TypeScript-like null safety.
And
For Kotlin level of strictness.
Rough example to showcase the difference:
The
Weak
null safety would not complain about such code, while theStrict
one will emit an error onvar notNullable:String = o.f;
becauseo.f
could be changed tonull
inmutate(o)
call.If different modes are used in the same build, a warning should be emitted and the least strict mode used.
The text was updated successfully, but these errors were encountered: