diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-04-15 21:18:18 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-04-16 11:10:05 +0200 |
commit | 7a347a0c9b9e6c1030eff7d994bf3c502ee8d297 (patch) | |
tree | de5bd1301fe20dbedafbf529f7be936b7651676d /src | |
parent | 62ac97d16a9231b71de84a50b3c0d32f554b34e4 (diff) | |
download | dotty-7a347a0c9b9e6c1030eff7d994bf3c502ee8d297.tar.gz dotty-7a347a0c9b9e6c1030eff7d994bf3c502ee8d297.tar.bz2 dotty-7a347a0c9b9e6c1030eff7d994bf3c502ee8d297.zip |
Give more precise types in desugarIdent.
It is known to return an actual Select.
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/backend/jvm/DottyBackendInterface.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala index a1137896b..1df564688 100644 --- a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala +++ b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala @@ -243,7 +243,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{ } case t: TypeApply if (t.fun.symbol == Predef_classOf) => av.visit(name, t.args.head.tpe.classSymbol.denot.info.toTypeKind(bcodeStore)(innerClasesStore).toASMType) - case t: Select => + case t: tpd.Select => if (t.symbol.denot.is(Flags.Enum)) { val edesc = innerClasesStore.typeDescriptor(t.tpe.asInstanceOf[bcodeStore.int.Type]) // the class descriptor of the enumeration class. val evalue = t.symbol.name.toString // value the actual enumeration value. @@ -416,7 +416,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{ def isQualifierSafeToElide(qual: Tree): Boolean = tpd.isIdempotentExpr(qual) - def desugarIdent(i: Ident): Option[Select] = { + def desugarIdent(i: Ident): Option[tpd.Select] = { i.tpe match { case TermRef(prefix: TermRef, name) => Some(tpd.ref(prefix).select(i.symbol)) @@ -869,7 +869,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{ override def unapply(s: Select): this.type = { s match { - case t: Select => desugared = t + case t: tpd.Select => desugared = t case t: Ident => desugarIdent(t) match { case Some(t) => desugared = t |