Skip to content

Fix #3669: Treat java repeated arguments like scalac's #3674

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 1 commit into from
Dec 18, 2017

Conversation

allanrenucci
Copy link
Contributor

Java repeated arguments are now treated as scala repeated arguments. They
are now replaced by a java array during ElimRepeated instead of Typer.

This change let us Ycheck one more MegaPhase. Previously java repeated
arguments would be replaced by a java array during typechecking which
prevented us from retypechecking the tree: Array[T] found, expected T*

@allanrenucci allanrenucci requested a review from odersky December 16, 2017 16:42
Java repeated arguments are now treated as scala repeated arguments. They
are now replaced by a java array during ElimRepeated instead of Typer.

This change let us Ycheck one more MegaPhase. Previously java repeated
arguments would be replaced by a java array during typechecking which
prevented us from retypechecking the tree: Array[T] found, expected T*
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.

This one looks actually very nice! Not clear why we we did not rely exclusively on ElimRepeated before.

@allanrenucci allanrenucci merged commit f4a22a8 into scala:master Dec 18, 2017
@allanrenucci allanrenucci deleted the ycheck branch December 18, 2017 12:44
@smarter
Copy link
Member

smarter commented Dec 18, 2017

@allanrenucci
Copy link
Contributor Author

@smarter Is this code snippet meant to handle java repeated?
This seems to be dead code. If the arg is a java repeated, then then readTerm() will return:

  • Typed(SeqLiteral, <repeated>) after this fix
  • Typed(JavaSeqLiteral, Array) before this fix

allanrenucci referenced this pull request Dec 19, 2017
Remove dead code for unpickling java repeated
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.

3 participants