@@ -231,7 +231,7 @@ object TastyImpl extends scala.tasty.Tasty {
231
231
232
232
implicit def TermDeco (t : Term ): AbstractTerm = new AbstractTerm {
233
233
def pos (implicit ctx : Context ): Position = new TastyPosition (t.pos)
234
- def tpe : Types .Type = t.tpe
234
+ def tpe ( implicit ctx : Context ) : Types .Type = t.tpe
235
235
}
236
236
237
237
def termClassTag : ClassTag [Term ] = implicitly[ClassTag [Term ]]
@@ -378,7 +378,7 @@ object TastyImpl extends scala.tasty.Tasty {
378
378
def unapply (x : Term )(implicit ctx : Context ): Option [(Term , Int , Type )] = x match {
379
379
case x : tpd.Select @ unchecked =>
380
380
x.name match {
381
- case NameKinds .OuterSelectName (_, levels) => Some ((x.qualifier, levels, x.tpe))
381
+ case NameKinds .OuterSelectName (_, levels) => Some ((x.qualifier, levels, x.tpe.stripTypeVar ))
382
382
case _ => None
383
383
}
384
384
case _ => None
@@ -405,7 +405,7 @@ object TastyImpl extends scala.tasty.Tasty {
405
405
406
406
implicit def PatternDeco (x : Pattern ): AbstractPattern = new AbstractPattern {
407
407
def pos (implicit ctx : Context ): Position = new TastyPosition (x.pos)
408
- def tpe : Types .Type = x.tpe
408
+ def tpe ( implicit ctx : Context ) : Types .Type = x.tpe.stripTypeVar
409
409
}
410
410
411
411
def patternClassTag : ClassTag [Pattern ] = implicitly[ClassTag [Pattern ]]
@@ -451,7 +451,7 @@ object TastyImpl extends scala.tasty.Tasty {
451
451
type MaybeTypeTree = tpd.Tree
452
452
453
453
implicit def MaybeTypeTreeDeco (x : MaybeTypeTree ): AbstractMaybeTypeTree = new AbstractMaybeTypeTree {
454
- def tpe : Type = x.tpe
454
+ def tpe ( implicit ctx : Context ) : Type = x.tpe.stripTypeVar
455
455
}
456
456
457
457
// ----- TypeTrees ------------------------------------------------
@@ -462,7 +462,7 @@ object TastyImpl extends scala.tasty.Tasty {
462
462
463
463
implicit def TypeTreeDeco (x : TypeTree ): AbstractTypeTree = new AbstractTypeTree {
464
464
def pos (implicit ctx : Context ): Position = new TastyPosition (x.pos)
465
- def tpe : Types .Type = x.tpe
465
+ def tpe ( implicit ctx : Context ) : Types .Type = x.tpe.stripTypeVar
466
466
}
467
467
468
468
val Synthetic : SyntheticExtractor = new SyntheticExtractor {
@@ -605,35 +605,35 @@ object TastyImpl extends scala.tasty.Tasty {
605
605
606
606
val AppliedType : AppliedTypeExtractor = new AppliedTypeExtractor {
607
607
def unapply (x : Type )(implicit ctx : Context ): Option [(Type , List [MaybeType /* Type | TypeBounds */ ])] = x match {
608
- case Types .AppliedType (tycon, args) => Some ((tycon, args))
608
+ case Types .AppliedType (tycon, args) => Some ((tycon.stripTypeVar , args.map(_.stripTypeVar) ))
609
609
case _ => None
610
610
}
611
611
}
612
612
613
613
val AnnotatedType : AnnotatedTypeExtractor = new AnnotatedTypeExtractor {
614
614
def unapply (x : Type )(implicit ctx : Context ): Option [(Type , Term )] = x match {
615
- case Types .AnnotatedType (underlying, annot) => Some ((underlying, annot.tree))
615
+ case Types .AnnotatedType (underlying, annot) => Some ((underlying.stripTypeVar , annot.tree))
616
616
case _ => None
617
617
}
618
618
}
619
619
620
620
val AndType : AndTypeExtractor = new AndTypeExtractor {
621
621
def unapply (x : Type )(implicit ctx : Context ): Option [(Type , Type )] = x match {
622
- case Types .AndType (left, right) => Some (left, right)
622
+ case Types .AndType (left, right) => Some (left.stripTypeVar , right.stripTypeVar )
623
623
case _ => None
624
624
}
625
625
}
626
626
627
627
val OrType : OrTypeExtractor = new OrTypeExtractor {
628
628
def unapply (x : Type )(implicit ctx : Context ): Option [(Type , Type )] = x match {
629
- case Types .OrType (left, right) => Some (left, right)
629
+ case Types .OrType (left, right) => Some (left.stripTypeVar , right.stripTypeVar )
630
630
case _ => None
631
631
}
632
632
}
633
633
634
634
val ByNameType : ByNameTypeExtractor = new ByNameTypeExtractor {
635
635
def unapply (x : Type )(implicit ctx : Context ): Option [Type ] = x match {
636
- case Types .ExprType (resType) => Some (resType)
636
+ case Types .ExprType (resType) => Some (resType.stripTypeVar )
637
637
case _ => None
638
638
}
639
639
}
@@ -668,7 +668,7 @@ object TastyImpl extends scala.tasty.Tasty {
668
668
669
669
val RecursiveType : RecursiveTypeExtractor = new RecursiveTypeExtractor {
670
670
def unapply (x : RecursiveType )(implicit ctx : Context ): Option [Type ] = x match {
671
- case tp : Types .RecType => Some (tp.underlying)
671
+ case tp : Types .RecType => Some (tp.underlying.stripTypeVar )
672
672
case _ => None
673
673
}
674
674
}
0 commit comments