-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Restricts isInstanceOf[Null]
checks
#12905
Conversation
Fixes #4004 `isInstanceOf[Nothing]` checks are always prohibited `isInstanceOf[Null]` checks are probihibited unless they can be proven at compiletime, then thay are simplified to `true`
What's the point of that? Also, |
I thought, checking it at compile-time can have some use cases for metaprogramming. @nicolasstucki, what is your opinion? On an unrelated note, I've forgotten about explicit nulls, which are apparently using Null type in matches. We can solve it by disallowing |
I think that the pattern match |
Yes, using explicit-nulls doesn't change the fact that |
also add `scala.Singleton` to untestable types
I've made |
Fixes #4004
isInstanceOf[Nothing]
,isInstanceOf[Null]
,isInstanceOf[Singleton]
checks are always prohibited