-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[work in progress] Arrays of value classes #1228
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/rebuild |
For a value class V whose underlying type is U, instead of representing an array of V as V[] on the JVM, we use our own class VCXArray where X is "U" if U is a primitive type and is "Object" otherwise. This avoids boxing when creating arrays but we still need to box and unbox when using such an array in a generic position, this also breaks reflection and makes it pretty hard to use an array of a value class from Java or Scala 2.
VCParents and VCArrays are updated; changes in representation (VCPrototype.scala); updates for classTag processing (arrays of value classes, VCXCompanion); bug fixes
…/scala (their implementation should be updated for new representation of arrays of value classes)
…rray.make to make them compatible with new representation of arrays of value classes.
See: #1558 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Represent an array of T where T is value class:
with the instance of VCXArray, where X is underlying type of T if X is primitive type and
Object
otherwise. In the current version of Dotty arrays of value classes are represented with T[] .The version in this pull request passes dotty test suite - runtime and compile time tests (checked based on 8af61ab Dotty version).
The work on this version is in progress. Current roadmap:
Previous pull request: 63243ab (part of the code is reused in this pull request and included in ee203b2)