Skip to content
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

Merged
merged 8 commits into from
Nov 21, 2023
Merged

Support intersection type casts #3652

merged 8 commits into from
Nov 21, 2023

Conversation

knutwannheden
Copy link
Contributor

@knutwannheden knutwannheden commented Oct 31, 2023

@timtebeek timtebeek added the bug Something isn't working label Oct 31, 2023
Copy link
Member

@sambsnyd sambsnyd left a 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

@sambsnyd
Copy link
Member

I don't think intersection can extend FullyQualified since it represents multiple types

@knutwannheden
Copy link
Contributor Author

@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...

@knutwannheden knutwannheden marked this pull request as ready for review November 21, 2023 08:23
@knutwannheden knutwannheden merged commit 552a4a8 into main Nov 21, 2023
1 check passed
@knutwannheden knutwannheden deleted the intersection-cast branch November 21, 2023 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Intersection type casts are not supported
4 participants