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

Fix checkNoModuleClash & avoid types with less precision loss #14274

Merged
merged 4 commits into from Jan 21, 2022

Conversation

dwijnand
Copy link
Member

@dwijnand dwijnand commented Jan 14, 2022

  • avoid cyclic error in checkNoModuleClash
  • retain some precision when avoiding types in invariant applied types

@dwijnand dwijnand linked an issue Jan 14, 2022 that may be closed by this pull request
@dwijnand dwijnand requested a review from odersky January 14, 2022 16:09
@dwijnand
Copy link
Member Author

Ah, fixing the owner used only fixes the type leak in the more minimised case, not the original one.

@dwijnand
Copy link
Member Author

OK, so this now fails because it does a capture wildcard on the RHS and that type doesn't match the type annotation:

val aa2: Array[? >: Nothing <: Array[? >: Nothing <: AnyRef]] = aa1.$asInstanceOf[Array[?1.CAP]]

@dwijnand dwijnand changed the title Avoid cyclic error in checkNoModuleClash Fix checkNoModuleClash & avoid types with less precision loss Jan 17, 2022
@dwijnand dwijnand marked this pull request as ready for review January 18, 2022 11:07
Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvements on both counts!

@odersky odersky merged commit c99f6ca into scala:master Jan 21, 2022
@dwijnand dwijnand deleted the arrays-crash branch January 21, 2022 14:04
@Kordyjan Kordyjan added this to the 3.1.2 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Too eager to remove wildcard types
4 participants