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
if (x eq null) throw new NullPointerException() //1
if (x eq null) throw null //2
x.getClass //3
We use option 2 in our null checks for the outer pointer in inner class constructors. I just noticed that javac used option 3 when spinning up a lambda based on an instance method reference.
That would be bad for performance in Scala.js. That said, it wouldn't be hard to optimize a call to getClass in statement position into a null check in our optimizer, if you choose to go that route.
These are semantically equivalent:
We use option 2 in our null checks for the outer pointer in inner class constructors. I just noticed that javac used option 3 when spinning up a lambda based on an instance method reference.
The text was updated successfully, but these errors were encountered: