-
Notifications
You must be signed in to change notification settings - Fork 365
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
Support intersection type casts #3652
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me
I don't think intersection can extend |
@sambsnyd In the Java compiler's model the intersection type does extend ClassType. I believe it has to do with the fact that an intersection type can only have one class and the others need to be interfaces. Alternatively all interfaces and Object as the implicit class. That way an intersection is pretty much the same as a regular class type and the fully qualified name would be the class name. But I am also unsure about this and wonder what problems we might get if we do this or don't do it... |
Supported since Java 1.8: https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.16
Fixes: #3651