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

SI-7521 Fix erasure of parametric value classes. #4124

Merged
merged 1 commit into from Nov 21, 2014

Conversation

retronym
Copy link
Member

Erasure.boxingErasure exists to ensure that we use boxed primitives
to represent the value, if the value class has type parameters
referred to by its element type.

However, this is implenented with a type map that runs deeply
across the type. In the enclosed test case, we have
Repr=Array[Int], which should be erased to Array[Int], not
to Array[Integer].

This commit ensures that the boxingErasure map only applies
boxing at the top level, and not within array arguments. (Other
type arguments will be erased, so we don't have to deal with them.)

Review by @gkossakowski

`Erasure.boxingErasure` exists to ensure that we use boxed primitives
to represent the value, if the value class has type parameters
referred to by its element type.

However, this is implenented with a type map that runs deeply
across the type. In the enclosed test case, we have
`Repr=Array[Int]`, which should be erased to `Array[Int]`, _not_
to `Array[Integer]`.

This commit ensures that the `boxingErasure` map only applies
boxing at the top level, and not within array arguments. (Other
type arguments will be erased, so we don't have to deal with them.)
@retronym
Copy link
Member Author

PLS REBUILD ALL

@scala-jenkins
Copy link

(kitty-note-to-self: ignore 62639043)
🐱 Roger! Rebuilding pr-scala for 362aa5c. 🚨

@retronym
Copy link
Member Author

PLS REBUILD ALL

@scala-jenkins
Copy link

(kitty-note-to-self: ignore 62668375)
🐱 Roger! Rebuilding pr-scala for 362aa5c. 🚨

@gkossakowski
Copy link
Member

LGTM

gkossakowski added a commit that referenced this pull request Nov 21, 2014
SI-7521 Fix erasure of parametric value classes.
@gkossakowski gkossakowski merged commit 6f5b853 into scala:2.12.x Nov 21, 2014
@adriaanm adriaanm added the 2.12 label Oct 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants