This repository was archived by the owner on Nov 27, 2018. It is now read-only.
Use Scala reflection api instead of scalap (2.10) #23
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.
First, please read the commit message:
Note: Scala reflection in Scala 2.10 is NOT threadsafe. As a result,
we need to be very careful about how we do things. This means:
materialization at the client site create safety issues
successfully requires that we use a reflective Universe that is
not shared with the outside world)
That said, there are a number of reasons to prefer the Scala reflection api
over scalap for type analysis. Here are a few:
Now some commentary:
This is a rather big change for jacks, so I'd expect there to be a bit
of discussion before it's decided whether to merge this. Please be
aware that I've also written another version of this idea that actually
updates JacksMapper to use TypeTags instead of Manifests and
doesn't use (jacks-side) locking or a separate reflective universe for
each ScalaModule. Unfortunately, that version depends on Scala
2.11 (which makes Scala reflection threadsafe through internal
locking), so I'd expect that it'd be less likely to be merged than this
(though parallel branches would obviously be possible). In any case,
look for another pull request with that version soon, though you
obviously don't want to merge both of them.