@@ -61,7 +61,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
61
61
type Alternative = tpd.Alternative
62
62
type DefDef = tpd.DefDef
63
63
type Template = tpd.Template
64
- type Select = tpd.Select
64
+ type Select = tpd.Tree // Actually tpd. Select || tpd.Ident
65
65
type Bind = tpd.Bind
66
66
type New = tpd.New
67
67
type Super = tpd.Super
@@ -243,7 +243,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
243
243
}
244
244
case t : TypeApply if (t.fun.symbol == Predef_classOf ) =>
245
245
av.visit(name, t.args.head.tpe.classSymbol.denot.info.toTypeKind(bcodeStore)(innerClasesStore).toASMType)
246
- case t : Select =>
246
+ case t : tpd. Select =>
247
247
if (t.symbol.denot.is(Flags .Enum )) {
248
248
val edesc = innerClasesStore.typeDescriptor(t.tpe.asInstanceOf [bcodeStore.int.Type ]) // the class descriptor of the enumeration class.
249
249
val evalue = t.symbol.name.toString // value the actual enumeration value.
@@ -416,7 +416,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
416
416
417
417
418
418
def isQualifierSafeToElide (qual : Tree ): Boolean = tpd.isIdempotentExpr(qual)
419
- def desugarIdent (i : Ident ): Option [Select ] = {
419
+ def desugarIdent (i : Ident ): Option [tpd. Select ] = {
420
420
i.tpe match {
421
421
case TermRef (prefix : TermRef , name) =>
422
422
Some (tpd.ref(prefix).select(i.symbol))
@@ -857,8 +857,29 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
857
857
}
858
858
859
859
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
+ }
862
883
}
863
884
864
885
object Apply extends ApplyDeconstructor {
0 commit comments