@@ -152,11 +152,11 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
152
152
case _ => None
153
153
}
154
154
155
- def TypeDef_rhs (self : TypeDef )(implicit ctx : Context ): TypeOrBoundsTree = self.rhs
155
+ def TypeDef_rhs (self : TypeDef )(implicit ctx : Context ): Tree /* TypeTree | TypeBoundsTree */ = self.rhs
156
156
def TypeDef_symbol (self : TypeDef )(implicit ctx : Context ): TypeSymbol = self.symbol.asType
157
157
158
158
def TypeDef_apply (symbol : TypeSymbol )(implicit ctx : Context ): TypeDef = withDefaultPos(ctx => tpd.TypeDef (symbol)(ctx))
159
- def TypeDef_copy (original : TypeDef )(name : String , rhs : TypeOrBoundsTree )(implicit ctx : Context ): TypeDef =
159
+ def TypeDef_copy (original : TypeDef )(name : String , rhs : Tree /* TypeTree | TypeBoundsTree */ )(implicit ctx : Context ): TypeDef =
160
160
tpd.cpy.TypeDef (original)(name.toTypeName, rhs)
161
161
162
162
type DefDef = tpd.DefDef
@@ -594,13 +594,9 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
594
594
def While_copy (original : Tree )(cond : Term , body : Term )(implicit ctx : Context ): While =
595
595
tpd.cpy.WhileDo (original)(cond, body)
596
596
597
- type TypeOrBoundsTree = tpd.Tree
598
-
599
- def TypeOrBoundsTree_tpe (self : TypeOrBoundsTree )(implicit ctx : Context ): Type = self.tpe.stripTypeVar
600
-
601
597
type TypeTree = tpd.Tree
602
598
603
- def matchTypeTree (x : TypeOrBoundsTree )(implicit ctx : Context ): Option [TypeTree ] = x match {
599
+ def matchTypeTree (x : Tree /* TypeTree | TypeBoundsTree */ )(implicit ctx : Context ): Option [TypeTree ] = x match {
604
600
case x : tpd.TypeBoundsTree => None
605
601
case _ => if (x.isType) Some (x) else None
606
602
}
@@ -611,7 +607,7 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
611
607
612
608
type TypeTree_Inferred = tpd.TypeTree
613
609
614
- def matchTypeTree_Inferred (tpt : TypeOrBoundsTree )(implicit ctx : Context ): Option [TypeTree_Inferred ] = tpt match {
610
+ def matchTypeTree_Inferred (tpt : Tree /* TypeTree | TypeBoundsTree */ )(implicit ctx : Context ): Option [TypeTree_Inferred ] = tpt match {
615
611
case tpt : tpd.TypeTree if ! tpt.tpe.isInstanceOf [Types .TypeBounds ] => Some (tpt)
616
612
case _ => None
617
613
}
@@ -620,7 +616,7 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
620
616
621
617
type TypeTree_Ident = tpd.Ident
622
618
623
- def matchTypeTree_Ident (tpt : TypeOrBoundsTree )(implicit ctx : Context ): Option [TypeTree_Ident ] = tpt match {
619
+ def matchTypeTree_Ident (tpt : Tree /* TypeTree | TypeBoundsTree */ )(implicit ctx : Context ): Option [TypeTree_Ident ] = tpt match {
624
620
case tpt : tpd.Ident if tpt.isType => Some (tpt)
625
621
case _ => None
626
622
}
@@ -632,7 +628,7 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
632
628
633
629
type TypeTree_Select = tpd.Select
634
630
635
- def matchTypeTree_Select (tpt : TypeOrBoundsTree )(implicit ctx : Context ): Option [TypeTree_Select ] = tpt match {
631
+ def matchTypeTree_Select (tpt : Tree /* TypeTree | TypeBoundsTree */ )(implicit ctx : Context ): Option [TypeTree_Select ] = tpt match {
636
632
case tpt : tpd.Select if tpt.isType && tpt.qualifier.isTerm => Some (tpt)
637
633
case _ => None
638
634
}
@@ -649,7 +645,7 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
649
645
650
646
type TypeTree_Projection = tpd.Select
651
647
652
- def matchTypeTree_Projection (tpt : TypeOrBoundsTree )(implicit ctx : Context ): Option [TypeTree_Projection ] = tpt match {
648
+ def matchTypeTree_Projection (tpt : Tree /* TypeTree | TypeBoundsTree */ )(implicit ctx : Context ): Option [TypeTree_Projection ] = tpt match {
653
649
case tpt : tpd.Select if tpt.isType && tpt.qualifier.isType => Some (tpt)
654
650
case _ => None
655
651
}
@@ -662,7 +658,7 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
662
658
663
659
type TypeTree_Singleton = tpd.SingletonTypeTree
664
660
665
- def matchTypeTree_Singleton (tpt : TypeOrBoundsTree )(implicit ctx : Context ): Option [TypeTree_Singleton ] = tpt match {
661
+ def matchTypeTree_Singleton (tpt : Tree /* TypeTree | TypeBoundsTree */ )(implicit ctx : Context ): Option [TypeTree_Singleton ] = tpt match {
666
662
case tpt : tpd.SingletonTypeTree => Some (tpt)
667
663
case _ => None
668
664
}
@@ -677,7 +673,7 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
677
673
678
674
type TypeTree_Refined = tpd.RefinedTypeTree
679
675
680
- def matchTypeTree_Refined (tpt : TypeOrBoundsTree )(implicit ctx : Context ): Option [TypeTree_Refined ] = tpt match {
676
+ def matchTypeTree_Refined (tpt : Tree /* TypeTree | TypeBoundsTree */ )(implicit ctx : Context ): Option [TypeTree_Refined ] = tpt match {
681
677
case tpt : tpd.RefinedTypeTree => Some (tpt)
682
678
case _ => None
683
679
}
@@ -690,23 +686,23 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
690
686
691
687
type TypeTree_Applied = tpd.AppliedTypeTree
692
688
693
- def matchTypeTree_Applied (tpt : TypeOrBoundsTree )(implicit ctx : Context ): Option [TypeTree_Applied ] = tpt match {
689
+ def matchTypeTree_Applied (tpt : Tree /* TypeTree | TypeBoundsTree */ )(implicit ctx : Context ): Option [TypeTree_Applied ] = tpt match {
694
690
case tpt : tpd.AppliedTypeTree => Some (tpt)
695
691
case _ => None
696
692
}
697
693
698
694
def TypeTree_Applied_tpt (self : TypeTree_Applied )(implicit ctx : Context ): TypeTree = self.tpt
699
- def TypeTree_Applied_args (self : TypeTree_Applied )(implicit ctx : Context ): List [TypeOrBoundsTree ] = self.args
695
+ def TypeTree_Applied_args (self : TypeTree_Applied )(implicit ctx : Context ): List [Tree /* TypeTree | TypeBoundsTree */ ] = self.args
700
696
701
- def TypeTree_Applied_apply (tpt : TypeTree , args : List [TypeOrBoundsTree ])(implicit ctx : Context ): TypeTree_Applied =
697
+ def TypeTree_Applied_apply (tpt : TypeTree , args : List [Tree /* TypeTree | TypeBoundsTree */ ])(implicit ctx : Context ): TypeTree_Applied =
702
698
withDefaultPos(ctx => tpd.AppliedTypeTree (tpt, args)(ctx))
703
699
704
- def TypeTree_Applied_copy (original : TypeTree_Applied )(tpt : TypeTree , args : List [TypeOrBoundsTree ])(implicit ctx : Context ): TypeTree_Applied =
700
+ def TypeTree_Applied_copy (original : TypeTree_Applied )(tpt : TypeTree , args : List [Tree /* TypeTree | TypeBoundsTree */ ])(implicit ctx : Context ): TypeTree_Applied =
705
701
tpd.cpy.AppliedTypeTree (original)(tpt, args)
706
702
707
703
type TypeTree_Annotated = tpd.Annotated
708
704
709
- def matchTypeTree_Annotated (tpt : TypeOrBoundsTree )(implicit ctx : Context ): Option [TypeTree_Annotated ] = tpt match {
705
+ def matchTypeTree_Annotated (tpt : Tree /* TypeTree | TypeBoundsTree */ )(implicit ctx : Context ): Option [TypeTree_Annotated ] = tpt match {
710
706
case tpt : tpd.Annotated => Some (tpt)
711
707
case _ => None
712
708
}
@@ -722,7 +718,7 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
722
718
723
719
type TypeTree_MatchType = tpd.MatchTypeTree
724
720
725
- def matchTypeTree_MatchType (tpt : TypeOrBoundsTree )(implicit ctx : Context ): Option [TypeTree_MatchType ] = tpt match {
721
+ def matchTypeTree_MatchType (tpt : Tree /* TypeTree | TypeBoundsTree */ )(implicit ctx : Context ): Option [TypeTree_MatchType ] = tpt match {
726
722
case tpt : tpd.MatchTypeTree => Some (tpt)
727
723
case _ => None
728
724
}
@@ -739,7 +735,7 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
739
735
740
736
type TypeTree_ByName = tpd.ByNameTypeTree
741
737
742
- def matchTypeTree_ByName (tpt : TypeOrBoundsTree )(implicit ctx : Context ): Option [TypeTree_ByName ] = tpt match {
738
+ def matchTypeTree_ByName (tpt : Tree /* TypeTree | TypeBoundsTree */ )(implicit ctx : Context ): Option [TypeTree_ByName ] = tpt match {
743
739
case tpt : tpd.ByNameTypeTree => Some (tpt)
744
740
case _ => None
745
741
}
@@ -754,36 +750,36 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
754
750
755
751
type TypeTree_LambdaTypeTree = tpd.LambdaTypeTree
756
752
757
- def matchTypeTree_LambdaTypeTree (tpt : TypeOrBoundsTree )(implicit ctx : Context ): Option [TypeTree_LambdaTypeTree ] = tpt match {
753
+ def matchTypeTree_LambdaTypeTree (tpt : Tree /* TypeTree | TypeBoundsTree */ )(implicit ctx : Context ): Option [TypeTree_LambdaTypeTree ] = tpt match {
758
754
case tpt : tpd.LambdaTypeTree => Some (tpt)
759
755
case _ => None
760
756
}
761
757
762
758
def TypeTree_LambdaTypeTree_tparams (self : TypeTree_LambdaTypeTree )(implicit ctx : Context ): List [TypeDef ] = self.tparams
763
- def TypeTree_LambdaTypeTree_body (self : TypeTree_LambdaTypeTree )(implicit ctx : Context ): TypeOrBoundsTree = self.body
759
+ def TypeTree_LambdaTypeTree_body (self : TypeTree_LambdaTypeTree )(implicit ctx : Context ): Tree /* TypeTree | TypeBoundsTree */ = self.body
764
760
765
- def TypeTree_LambdaTypeTree_apply (tparams : List [TypeDef ], body : TypeOrBoundsTree )(implicit ctx : Context ): TypeTree_LambdaTypeTree =
761
+ def TypeTree_LambdaTypeTree_apply (tparams : List [TypeDef ], body : Tree /* TypeTree | TypeBoundsTree */ )(implicit ctx : Context ): TypeTree_LambdaTypeTree =
766
762
withDefaultPos(ctx => tpd.LambdaTypeTree (tparams, body)(ctx))
767
763
768
- def TypeTree_LambdaTypeTree_copy (original : TypeTree_LambdaTypeTree )(tparams : List [TypeDef ], body : TypeOrBoundsTree )(implicit ctx : Context ): TypeTree_LambdaTypeTree =
764
+ def TypeTree_LambdaTypeTree_copy (original : TypeTree_LambdaTypeTree )(tparams : List [TypeDef ], body : Tree /* TypeTree | TypeBoundsTree */ )(implicit ctx : Context ): TypeTree_LambdaTypeTree =
769
765
tpd.cpy.LambdaTypeTree (original)(tparams, body)
770
766
771
767
type TypeTree_TypeBind = tpd.Bind
772
768
773
- def matchTypeTree_TypeBind (tpt : TypeOrBoundsTree )(implicit ctx : Context ): Option [TypeTree_TypeBind ] = tpt match {
769
+ def matchTypeTree_TypeBind (tpt : Tree /* TypeTree | TypeBoundsTree */ )(implicit ctx : Context ): Option [TypeTree_TypeBind ] = tpt match {
774
770
case tpt : tpd.Bind if tpt.name.isTypeName => Some (tpt)
775
771
case _ => None
776
772
}
777
773
778
774
def TypeTree_TypeBind_name (self : TypeTree_TypeBind )(implicit ctx : Context ): String = self.name.toString
779
- def TypeTree_TypeBind_body (self : TypeTree_TypeBind )(implicit ctx : Context ): TypeOrBoundsTree = self.body
775
+ def TypeTree_TypeBind_body (self : TypeTree_TypeBind )(implicit ctx : Context ): Tree /* TypeTree | TypeBoundsTree */ = self.body
780
776
781
- def TypeTree_TypeBind_copy (original : TypeTree_TypeBind )(name : String , tpt : TypeOrBoundsTree )(implicit ctx : Context ): TypeTree_TypeBind =
777
+ def TypeTree_TypeBind_copy (original : TypeTree_TypeBind )(name : String , tpt : Tree /* TypeTree | TypeBoundsTree */ )(implicit ctx : Context ): TypeTree_TypeBind =
782
778
tpd.cpy.Bind (original)(name.toTypeName, tpt)
783
779
784
780
type TypeTree_TypeBlock = tpd.Block
785
781
786
- def matchTypeTree_TypeBlock (tpt : TypeOrBoundsTree )(implicit ctx : Context ): Option [TypeTree_TypeBlock ] = tpt match {
782
+ def matchTypeTree_TypeBlock (tpt : Tree /* TypeTree | TypeBoundsTree */ )(implicit ctx : Context ): Option [TypeTree_TypeBlock ] = tpt match {
787
783
case tpt : tpd.Block => Some (tpt)
788
784
case _ => None
789
785
}
@@ -799,7 +795,7 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
799
795
800
796
type TypeBoundsTree = tpd.TypeBoundsTree
801
797
802
- def matchTypeBoundsTree (x : TypeOrBoundsTree )(implicit ctx : Context ): Option [TypeBoundsTree ] = x match {
798
+ def matchTypeBoundsTree (x : Tree /* TypeTree | TypeBoundsTree */ )(implicit ctx : Context ): Option [TypeBoundsTree ] = x match {
803
799
case x : tpd.TypeBoundsTree => Some (x)
804
800
case x @ Trees .TypeTree () =>
805
801
// TODO only enums generate this kind of type bounds. Is this possible without enums? If not generate tpd.TypeBoundsTree for enums instead
@@ -817,11 +813,13 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
817
813
818
814
type WildcardTypeTree = tpd.Ident
819
815
820
- def matchWildcardTypeTree (x : TypeOrBoundsTree )(implicit ctx : Context ): Option [WildcardTypeTree ] = x match {
816
+ def matchWildcardTypeTree (x : Tree /* TypeTree | TypeBoundsTree */ )(implicit ctx : Context ): Option [WildcardTypeTree ] = x match {
821
817
case x @ Trees .Ident (nme.WILDCARD ) => Some (x)
822
818
case _ => None
823
819
}
824
820
821
+ def WildcardTypeTree_tpe (self : WildcardTypeTree )(implicit ctx : Context ): TypeOrBounds = self.tpe.stripTypeVar
822
+
825
823
//
826
824
// CASES
827
825
//
0 commit comments