diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2015-03-18 23:56:19 +0100 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-05-01 13:26:23 +0200 |
commit | 5dec4ce8a64d44ee602c09d468414b13eecba389 (patch) | |
tree | 3df31764445c447029d2114e25c95d83a60e4c0a /src/dotty/tools/dotc/core/Symbols.scala | |
parent | 391c80c4dfb2489e4098af33265b22332ef3d5f1 (diff) | |
download | dotty-5dec4ce8a64d44ee602c09d468414b13eecba389.tar.gz dotty-5dec4ce8a64d44ee602c09d468414b13eecba389.tar.bz2 dotty-5dec4ce8a64d44ee602c09d468414b13eecba389.zip |
Erasure: properly erase value classes
There are three ways to erase a value class:
- In most case, it should be semi-erased to an ErasedValueType, which will be
fully erased to its underlying type in ElimErasedValueType.
This corresponds to semiEraseVCs = true in TypeErasure.
- In a few cases, it should be erased like a normal class, so far this
seems to be necessary for:
* The return type of a constructor
* The underlying type of a ThisType
* TypeTree nodes inside New nodes
* TypeApply nodes
* Arrays
In these cases, we set semiEraseVCs = false
- When calling `sigName` it should be erased to its underlying type.
This commit implements all these cases. Note that this breaks most tests
because ElimErasedValueType has not been implemented yet, it is part of
the next commit.
Diffstat (limited to 'src/dotty/tools/dotc/core/Symbols.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Symbols.scala | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala index 9f18e723c..2b91efbcd 100644 --- a/src/dotty/tools/dotc/core/Symbols.scala +++ b/src/dotty/tools/dotc/core/Symbols.scala @@ -434,14 +434,6 @@ object Symbols { /** If this symbol satisfies predicate `p` this symbol, otherwise `NoSymbol` */ def filter(p: Symbol => Boolean): Symbol = if (p(this)) this else NoSymbol - /** Is this symbol a user-defined value class? */ - final def isDerivedValueClass(implicit ctx: Context): Boolean = { - this.derivesFrom(defn.AnyValClass)(ctx.withPhase(denot.validFor.firstPhaseId)) - // Simulate ValueClasses.isDerivedValueClass - false // will migrate to ValueClasses.isDerivedValueClass; - // unsupported value class code will continue to use this stub while it exists - } - /** The current name of this symbol */ final def name(implicit ctx: Context): ThisName = denot.name.asInstanceOf[ThisName] |