-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Wrong erasure for SeqLiteral elements #4375
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
Comments
Minimizable further to object App {
type Id[A] >: A <: A
val a: List[_ >: Id[_]] = List(0)
} First impression: Per restrictions on existentials, we should probably reject
which is accepted by the REPL. Worse, if we replace the definition of
|
The object App {
type Id[A] >: A
val a: List[_ >: Id[Int]] = List(1,2)
} I'm on it. |
@Blaisorblade However, the fact that |
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.
The text was updated successfully, but these errors were encountered: