Skip to content

Fix #533: Some isAbstractType tests should succeed for parameters #3931

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

Merged
merged 2 commits into from
Jan 30, 2018

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jan 26, 2018

Introduce a new test isAbstractOrParamType to capture this. Sicne we did not do this
before, we missed out on the Array[T] --> Array[T & Object] transform for genereic
Java arrays.

The fix also needs an opposite fix to "undo" the parameter encoding again in arrayToRepeated.

@odersky
Copy link
Contributor Author

odersky commented Jan 26, 2018

This PR also fixes #1747, using the same technique as scalac.

@liufengyun
Copy link
Contributor

Need to rebase because of #3892

…parameters

Introduce a new test isAbstractOrParamType to capture this. Sicne we did not do this
before, we missed out on the `Array[T] --> Array[T & Object]` transform for genereic
Java arrays.

The fix also needs an opposite fix to "undo" the parameter encoding again in arrayToRepeated.
This also fixes scala#1747 by allowing the same encoding as `scalac` to cope
with overridden methods over unbounded generic arrays.
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

Otherwise, LGTM

final val DeferredOrTermParamOrAccessor = Deferred | TermParam | ParamAccessor

/** A deferred term member or a parameter accessor (these don't have right hand sides) */
final val DeferredOrTypeParam = Deferred | TypeParam
Copy link
Contributor

Choose a reason for hiding this comment

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

The doc says Deferred term member or a parameter accessor, which is incorrect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I'll roll that into a future PR.

@liufengyun liufengyun assigned odersky and unassigned liufengyun Jan 30, 2018
@odersky odersky merged commit b3f49a9 into scala:master Jan 30, 2018
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.

2 participants