@@ -61,7 +61,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
6161 type Alternative = tpd.Alternative
6262 type DefDef = tpd.DefDef
6363 type Template = tpd.Template
64- type Select = tpd.Select
64+ type Select = tpd.Tree // Actually tpd. Select || tpd.Ident
6565 type Bind = tpd.Bind
6666 type New = tpd.New
6767 type Super = tpd.Super
@@ -243,7 +243,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
243243 }
244244 case t : TypeApply if (t.fun.symbol == Predef_classOf ) =>
245245 av.visit(name, t.args.head.tpe.classSymbol.denot.info.toTypeKind(bcodeStore)(innerClasesStore).toASMType)
246- case t : Select =>
246+ case t : tpd. Select =>
247247 if (t.symbol.denot.is(Flags .Enum )) {
248248 val edesc = innerClasesStore.typeDescriptor(t.tpe.asInstanceOf [bcodeStore.int.Type ]) // the class descriptor of the enumeration class.
249249 val evalue = t.symbol.name.toString // value the actual enumeration value.
@@ -416,7 +416,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
416416
417417
418418 def isQualifierSafeToElide (qual : Tree ): Boolean = tpd.isIdempotentExpr(qual)
419- def desugarIdent (i : Ident ): Option [Select ] = {
419+ def desugarIdent (i : Ident ): Option [tpd. Select ] = {
420420 i.tpe match {
421421 case TermRef (prefix : TermRef , name) =>
422422 Some (tpd.ref(prefix).select(i.symbol))
@@ -857,8 +857,29 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
857857 }
858858
859859 object Select extends SelectDeconstructor {
860- def _1 : Tree = field.qualifier
861- def _2 : Name = field.name
860+
861+ var desugared : tpd.Select = null
862+
863+ override def isEmpty : Boolean =
864+ desugared eq null
865+
866+ def _1 : Tree = desugared.qualifier
867+
868+ def _2 : Name = desugared.name
869+
870+ override def unapply (s : Select ): this .type = {
871+ s match {
872+ case t : tpd.Select => desugared = t
873+ case t : Ident =>
874+ desugarIdent(t) match {
875+ case Some (t) => desugared = t
876+ case None => desugared = null
877+ }
878+ case _ => desugared = null
879+ }
880+
881+ this
882+ }
862883 }
863884
864885 object Apply extends ApplyDeconstructor {
0 commit comments