You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Relax flow typing checks on Flexible Types (#24278)
These changes allow flow-typing to view flexible types as non-nullable
at relevant places.
```scala
//> using options -Yexplicit-nulls
def main() =
var result: String | Null = null
result = "".trim()
result.trim()
```
Without this PR, the access of trim on result will give an error. This
pattern is used in community build projects like sconfig.
After this change, calling .nn on a flexible type **directly** will
still not give a warning, as intended.
However, calling .nn on a variable that is previously flow typed to be a
flexible type will now give a warning as a side effect of this change.
We believe that the benefits of this change outweigh the drawback.
0 commit comments