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
Apply Flexible Types to Symbols from files compiled without Explicit Nulls (#22473)
This PR wraps the types of symbols from files compiled without explicit
nulls in flexible types.
This allows for interop between multiple files in cases where
```
class Unsafe_1 {
def foo(s: String): String = {
if (s == null) then "nullString"
else s
}
}
```
compiled without explicit nulls can still be used in
```
def Flexible_2() =
val s2: String | Null = "foo"
val unsafe = new Unsafe_1()
val s: String = unsafe.foo(s2)
unsafe.foo("")
unsafe.foo(null)
```
whereas the argument would have been a **strictly non-null** String,
because of the flexible type, the function call is now permitted.
0 commit comments