Skip to content

Fix #4375: Properly erase SeqLiteral #4387

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
Apr 27, 2018

Conversation

smarter
Copy link
Member

@smarter smarter commented Apr 26, 2018

Before this commit, the SeqLiteral#elems were typed based on the
SeqLiteral prototype, which means that nothing ensured that the elems
types conformed to the type of SeqLiteral#elemtpt. In i4375.scala this
means that erasing SeqLiteral([1, 2], Object) did not box each element
because the expected element type was WildcardType.

To prevent this sort of issue, we now use the type of SeqLiteral#elemtpt
if it exists as the expected type of each element in the sequence.

@smarter smarter requested a review from odersky April 26, 2018 15:07
Before this commit, the `SeqLiteral#elems` were typed based on the
SeqLiteral prototype, which means that nothing ensured that the elems
types conformed to the type of `SeqLiteral#elemtpt`. In i4375.scala this
means that erasing `SeqLiteral([1, 2], Object)` did not box each element
because the expected element type was `WildcardType`.

To prevent this sort of issue, we now use the type of SeqLiteral#elemtpt
if it exists as the expected type of each element in the sequence.
@smarter smarter force-pushed the fix/seqliteral-erasure branch from c5742d5 to bea7430 Compare April 26, 2018 15:15
@odersky odersky merged commit 747c2ae into scala:master Apr 27, 2018
@allanrenucci allanrenucci deleted the fix/seqliteral-erasure branch April 27, 2018 11:43
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