diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2015-03-18 23:56:07 +0100 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-05-01 13:26:22 +0200 |
commit | 391c80c4dfb2489e4098af33265b22332ef3d5f1 (patch) | |
tree | 206abc627f2a4cf5404547f554cd448492351a16 /src/dotty/tools/dotc/core/Symbols.scala | |
parent | f168970f38df1d1ccc2b262f1a77f72cd4ec9f39 (diff) | |
download | dotty-391c80c4dfb2489e4098af33265b22332ef3d5f1.tar.gz dotty-391c80c4dfb2489e4098af33265b22332ef3d5f1.tar.bz2 dotty-391c80c4dfb2489e4098af33265b22332ef3d5f1.zip |
Add synthetic casts to and from ErasedValueType
For a value class V, let U be the underlying type after
erasure. We add to the companion object of V two cast methods:
def u2evt$(x0: U): ErasedValueType(V, U)
def evt2u$(x0: ErasedValueType(V, U)): U
The casts are used in Erasure to make it typecheck, they are then removed
in ElimErasedValueType (not yet present in this commit). This is
different from the implementation of value classes in Scala 2 (see
SIP-15) which uses `asInstanceOf` which does not typecheck.
Diffstat (limited to 'src/dotty/tools/dotc/core/Symbols.scala')
0 files changed, 0 insertions, 0 deletions