@@ -171,14 +171,14 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
171
171
}
172
172
173
173
def ClassDef_constructor (self : ClassDef )(implicit ctx : Context ): DefDef = ClassDef_rhs (self).constr
174
- def ClassDef_parents (self : ClassDef )(implicit ctx : Context ): List [Tree /* Term | TypeTree */ ] = ClassDef_rhs (self).parents
174
+ def ClassDef_parents (self : ClassDef )(implicit ctx : Context ): List [Term | TypeTree ] = ClassDef_rhs (self).parents
175
175
def ClassDef_derived (self : ClassDef )(implicit ctx : Context ): List [TypeTree ] = ClassDef_rhs (self).derived.asInstanceOf [List [TypeTree ]]
176
176
def ClassDef_self (self : ClassDef )(implicit ctx : Context ): Option [ValDef ] = optional(ClassDef_rhs (self).self)
177
177
def ClassDef_body (self : ClassDef )(implicit ctx : Context ): List [Statement ] = ClassDef_rhs (self).body
178
178
def ClassDef_symbol (self : ClassDef )(implicit ctx : Context ): ClassDefSymbol = self.symbol.asClass
179
179
private def ClassDef_rhs (self : ClassDef ) = self.rhs.asInstanceOf [tpd.Template ]
180
180
181
- def ClassDef_copy (original : ClassDef )(name : String , constr : DefDef , parents : List [Tree /* Term | TypeTree */ ], derived : List [TypeTree ], selfOpt : Option [ValDef ], body : List [Statement ])(implicit ctx : Context ): ClassDef = {
181
+ def ClassDef_copy (original : ClassDef )(name : String , constr : DefDef , parents : List [Term | TypeTree ], derived : List [TypeTree ], selfOpt : Option [ValDef ], body : List [Statement ])(implicit ctx : Context ): ClassDef = {
182
182
val Trees .TypeDef (_, originalImpl : tpd.Template ) = original
183
183
tpd.cpy.TypeDef (original)(name.toTypeName, tpd.cpy.Template (originalImpl)(constr, parents, derived, selfOpt.getOrElse(tpd.EmptyValDef ), body))
184
184
}
@@ -190,11 +190,11 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
190
190
case _ => None
191
191
}
192
192
193
- def TypeDef_rhs (self : TypeDef )(implicit ctx : Context ): Tree /* TypeTree | TypeBoundsTree*/ = self.rhs
193
+ def TypeDef_rhs (self : TypeDef )(implicit ctx : Context ): TypeTree | TypeBoundsTree = self.rhs
194
194
def TypeDef_symbol (self : TypeDef )(implicit ctx : Context ): TypeDefSymbol = self.symbol.asType
195
195
196
196
def TypeDef_apply (symbol : TypeDefSymbol )(implicit ctx : Context ): TypeDef = withDefaultPos(ctx => tpd.TypeDef (symbol)(ctx))
197
- def TypeDef_copy (original : TypeDef )(name : String , rhs : Tree /* TypeTree | TypeBoundsTree*/ )(implicit ctx : Context ): TypeDef =
197
+ def TypeDef_copy (original : TypeDef )(name : String , rhs : TypeTree | TypeBoundsTree )(implicit ctx : Context ): TypeDef =
198
198
tpd.cpy.TypeDef (original)(name.toTypeName, rhs)
199
199
200
200
type DefDef = tpd.DefDef
@@ -493,14 +493,14 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
493
493
case _ => None
494
494
}
495
495
496
- def Inlined_call (self : Inlined )(implicit ctx : Context ): Option [Tree /* Term | TypeTree */ ] = optional(self.call)
496
+ def Inlined_call (self : Inlined )(implicit ctx : Context ): Option [Term | TypeTree ] = optional(self.call)
497
497
def Inlined_bindings (self : Inlined )(implicit ctx : Context ): List [Definition ] = self.bindings
498
498
def Inlined_body (self : Inlined )(implicit ctx : Context ): Term = self.expansion
499
499
500
- def Inlined_apply (call : Option [Tree /* Term | TypeTree */ ], bindings : List [Definition ], expansion : Term )(implicit ctx : Context ): Inlined =
500
+ def Inlined_apply (call : Option [Term | TypeTree ], bindings : List [Definition ], expansion : Term )(implicit ctx : Context ): Inlined =
501
501
withDefaultPos(ctx => tpd.Inlined (call.getOrElse(tpd.EmptyTree ), bindings.map { case b : tpd.MemberDef => b }, expansion)(ctx))
502
502
503
- def Inlined_copy (original : Tree )(call : Option [Tree /* Term | TypeTree */ ], bindings : List [Definition ], expansion : Term )(implicit ctx : Context ): Inlined =
503
+ def Inlined_copy (original : Tree )(call : Option [Term | TypeTree ], bindings : List [Definition ], expansion : Term )(implicit ctx : Context ): Inlined =
504
504
tpd.cpy.Inlined (original)(call.getOrElse(tpd.EmptyTree ), bindings.asInstanceOf [List [tpd.MemberDef ]], expansion)
505
505
506
506
type Lambda = tpd.Closure
@@ -657,7 +657,7 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
657
657
658
658
type TypeTree = tpd.Tree
659
659
660
- def matchTypeTree (x : Tree /* TypeTree | TypeBoundsTree*/ )(implicit ctx : Context ): Option [TypeTree ] = x match {
660
+ def matchTypeTree (x : TypeTree | TypeBoundsTree )(implicit ctx : Context ): Option [TypeTree ] = x match {
661
661
case x : tpd.TypeBoundsTree => None
662
662
case _ => if (x.isType) Some (x) else None
663
663
}
@@ -668,7 +668,7 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
668
668
669
669
type Inferred = tpd.TypeTree
670
670
671
- def matchInferred (tpt : Tree /* TypeTree | TypeBoundsTree*/ )(implicit ctx : Context ): Option [Inferred ] = tpt match {
671
+ def matchInferred (tpt : TypeTree | TypeBoundsTree )(implicit ctx : Context ): Option [Inferred ] = tpt match {
672
672
case tpt : tpd.TypeTree if ! tpt.tpe.isInstanceOf [Types .TypeBounds ] => Some (tpt)
673
673
case _ => None
674
674
}
@@ -677,7 +677,7 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
677
677
678
678
type TypeIdent = tpd.Ident
679
679
680
- def matchTypeIdent (tpt : Tree /* TypeTree | TypeBoundsTree*/ )(implicit ctx : Context ): Option [TypeIdent ] = tpt match {
680
+ def matchTypeIdent (tpt : TypeTree | TypeBoundsTree )(implicit ctx : Context ): Option [TypeIdent ] = tpt match {
681
681
case tpt : tpd.Ident if tpt.isType => Some (tpt)
682
682
case _ => None
683
683
}
@@ -689,7 +689,7 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
689
689
690
690
type TypeSelect = tpd.Select
691
691
692
- def matchTypeSelect (tpt : Tree /* TypeTree | TypeBoundsTree*/ )(implicit ctx : Context ): Option [TypeSelect ] = tpt match {
692
+ def matchTypeSelect (tpt : TypeTree | TypeBoundsTree )(implicit ctx : Context ): Option [TypeSelect ] = tpt match {
693
693
case tpt : tpd.Select if tpt.isType && tpt.qualifier.isTerm => Some (tpt)
694
694
case _ => None
695
695
}
@@ -706,7 +706,7 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
706
706
707
707
type Projection = tpd.Select
708
708
709
- def matchProjection (tpt : Tree /* TypeTree | TypeBoundsTree*/ )(implicit ctx : Context ): Option [Projection ] = tpt match {
709
+ def matchProjection (tpt : TypeTree | TypeBoundsTree )(implicit ctx : Context ): Option [Projection ] = tpt match {
710
710
case tpt : tpd.Select if tpt.isType && tpt.qualifier.isType => Some (tpt)
711
711
case _ => None
712
712
}
@@ -719,7 +719,7 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
719
719
720
720
type Singleton = tpd.SingletonTypeTree
721
721
722
- def matchSingleton (tpt : Tree /* TypeTree | TypeBoundsTree*/ )(implicit ctx : Context ): Option [Singleton ] = tpt match {
722
+ def matchSingleton (tpt : TypeTree | TypeBoundsTree )(implicit ctx : Context ): Option [Singleton ] = tpt match {
723
723
case tpt : tpd.SingletonTypeTree => Some (tpt)
724
724
case _ => None
725
725
}
@@ -734,7 +734,7 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
734
734
735
735
type Refined = tpd.RefinedTypeTree
736
736
737
- def matchRefined (tpt : Tree /* TypeTree | TypeBoundsTree*/ )(implicit ctx : Context ): Option [Refined ] = tpt match {
737
+ def matchRefined (tpt : TypeTree | TypeBoundsTree )(implicit ctx : Context ): Option [Refined ] = tpt match {
738
738
case tpt : tpd.RefinedTypeTree => Some (tpt)
739
739
case _ => None
740
740
}
@@ -747,23 +747,23 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
747
747
748
748
type Applied = tpd.AppliedTypeTree
749
749
750
- def matchApplied (tpt : Tree /* TypeTree | TypeBoundsTree*/ )(implicit ctx : Context ): Option [Applied ] = tpt match {
750
+ def matchApplied (tpt : TypeTree | TypeBoundsTree )(implicit ctx : Context ): Option [Applied ] = tpt match {
751
751
case tpt : tpd.AppliedTypeTree => Some (tpt)
752
752
case _ => None
753
753
}
754
754
755
755
def Applied_tpt (self : Applied )(implicit ctx : Context ): TypeTree = self.tpt
756
- def Applied_args (self : Applied )(implicit ctx : Context ): List [Tree /* TypeTree | TypeBoundsTree*/ ] = self.args
756
+ def Applied_args (self : Applied )(implicit ctx : Context ): List [TypeTree | TypeBoundsTree ] = self.args
757
757
758
- def Applied_apply (tpt : TypeTree , args : List [Tree /* TypeTree | TypeBoundsTree*/ ])(implicit ctx : Context ): Applied =
758
+ def Applied_apply (tpt : TypeTree , args : List [TypeTree | TypeBoundsTree ])(implicit ctx : Context ): Applied =
759
759
withDefaultPos(ctx => tpd.AppliedTypeTree (tpt, args)(ctx))
760
760
761
- def Applied_copy (original : Applied )(tpt : TypeTree , args : List [Tree /* TypeTree | TypeBoundsTree*/ ])(implicit ctx : Context ): Applied =
761
+ def Applied_copy (original : Applied )(tpt : TypeTree , args : List [TypeTree | TypeBoundsTree ])(implicit ctx : Context ): Applied =
762
762
tpd.cpy.AppliedTypeTree (original)(tpt, args)
763
763
764
764
type Annotated = tpd.Annotated
765
765
766
- def matchAnnotated (tpt : Tree /* TypeTree | TypeBoundsTree*/ )(implicit ctx : Context ): Option [Annotated ] = tpt match {
766
+ def matchAnnotated (tpt : TypeTree | TypeBoundsTree )(implicit ctx : Context ): Option [Annotated ] = tpt match {
767
767
case tpt : tpd.Annotated => Some (tpt)
768
768
case _ => None
769
769
}
@@ -779,7 +779,7 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
779
779
780
780
type MatchTypeTree = tpd.MatchTypeTree
781
781
782
- def matchMatchTypeTree (tpt : Tree /* TypeTree | TypeBoundsTree*/ )(implicit ctx : Context ): Option [MatchTypeTree ] = tpt match {
782
+ def matchMatchTypeTree (tpt : TypeTree | TypeBoundsTree )(implicit ctx : Context ): Option [MatchTypeTree ] = tpt match {
783
783
case tpt : tpd.MatchTypeTree => Some (tpt)
784
784
case _ => None
785
785
}
@@ -796,7 +796,7 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
796
796
797
797
type ByName = tpd.ByNameTypeTree
798
798
799
- def matchByName (tpt : Tree /* TypeTree | TypeBoundsTree*/ )(implicit ctx : Context ): Option [ByName ] = tpt match {
799
+ def matchByName (tpt : TypeTree | TypeBoundsTree )(implicit ctx : Context ): Option [ByName ] = tpt match {
800
800
case tpt : tpd.ByNameTypeTree => Some (tpt)
801
801
case _ => None
802
802
}
@@ -811,36 +811,36 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
811
811
812
812
type LambdaTypeTree = tpd.LambdaTypeTree
813
813
814
- def matchLambdaTypeTree (tpt : Tree /* TypeTree | TypeBoundsTree*/ )(implicit ctx : Context ): Option [LambdaTypeTree ] = tpt match {
814
+ def matchLambdaTypeTree (tpt : TypeTree | TypeBoundsTree )(implicit ctx : Context ): Option [LambdaTypeTree ] = tpt match {
815
815
case tpt : tpd.LambdaTypeTree => Some (tpt)
816
816
case _ => None
817
817
}
818
818
819
819
def Lambdatparams (self : LambdaTypeTree )(implicit ctx : Context ): List [TypeDef ] = self.tparams
820
- def Lambdabody (self : LambdaTypeTree )(implicit ctx : Context ): Tree /* TypeTree | TypeBoundsTree*/ = self.body
820
+ def Lambdabody (self : LambdaTypeTree )(implicit ctx : Context ): TypeTree | TypeBoundsTree = self.body
821
821
822
- def Lambdaapply (tparams : List [TypeDef ], body : Tree /* TypeTree | TypeBoundsTree*/ )(implicit ctx : Context ): LambdaTypeTree =
822
+ def Lambdaapply (tparams : List [TypeDef ], body : TypeTree | TypeBoundsTree )(implicit ctx : Context ): LambdaTypeTree =
823
823
withDefaultPos(ctx => tpd.LambdaTypeTree (tparams, body)(ctx))
824
824
825
- def Lambdacopy (original : LambdaTypeTree )(tparams : List [TypeDef ], body : Tree /* TypeTree | TypeBoundsTree*/ )(implicit ctx : Context ): LambdaTypeTree =
825
+ def Lambdacopy (original : LambdaTypeTree )(tparams : List [TypeDef ], body : TypeTree | TypeBoundsTree )(implicit ctx : Context ): LambdaTypeTree =
826
826
tpd.cpy.LambdaTypeTree (original)(tparams, body)
827
827
828
828
type TypeBind = tpd.Bind
829
829
830
- def matchTypeBind (tpt : Tree /* TypeTree | TypeBoundsTree*/ )(implicit ctx : Context ): Option [TypeBind ] = tpt match {
830
+ def matchTypeBind (tpt : TypeTree | TypeBoundsTree )(implicit ctx : Context ): Option [TypeBind ] = tpt match {
831
831
case tpt : tpd.Bind if tpt.name.isTypeName => Some (tpt)
832
832
case _ => None
833
833
}
834
834
835
835
def TypeBind_name (self : TypeBind )(implicit ctx : Context ): String = self.name.toString
836
- def TypeBind_body (self : TypeBind )(implicit ctx : Context ): Tree /* TypeTree | TypeBoundsTree*/ = self.body
836
+ def TypeBind_body (self : TypeBind )(implicit ctx : Context ): TypeTree | TypeBoundsTree = self.body
837
837
838
- def TypeBind_copy (original : TypeBind )(name : String , tpt : Tree /* TypeTree | TypeBoundsTree*/ )(implicit ctx : Context ): TypeBind =
838
+ def TypeBind_copy (original : TypeBind )(name : String , tpt : TypeTree | TypeBoundsTree )(implicit ctx : Context ): TypeBind =
839
839
tpd.cpy.Bind (original)(name.toTypeName, tpt)
840
840
841
841
type TypeBlock = tpd.Block
842
842
843
- def matchTypeBlock (tpt : Tree /* TypeTree | TypeBoundsTree*/ )(implicit ctx : Context ): Option [TypeBlock ] = tpt match {
843
+ def matchTypeBlock (tpt : TypeTree | TypeBoundsTree )(implicit ctx : Context ): Option [TypeBlock ] = tpt match {
844
844
case tpt : tpd.Block => Some (tpt)
845
845
case _ => None
846
846
}
@@ -856,7 +856,7 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
856
856
857
857
type TypeBoundsTree = tpd.TypeBoundsTree
858
858
859
- def matchTypeBoundsTree (x : Tree /* TypeTree | TypeBoundsTree*/ )(implicit ctx : Context ): Option [TypeBoundsTree ] = x match {
859
+ def matchTypeBoundsTree (x : TypeTree | TypeBoundsTree )(implicit ctx : Context ): Option [TypeBoundsTree ] = x match {
860
860
case x : tpd.TypeBoundsTree => Some (x)
861
861
case x @ Trees .TypeTree () =>
862
862
// TODO only enums generate this kind of type bounds. Is this possible without enums? If not generate tpd.TypeBoundsTree for enums instead
@@ -874,7 +874,7 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
874
874
875
875
type WildcardTypeTree = tpd.Ident
876
876
877
- def matchWildcardTypeTree (x : Tree /* TypeTree | TypeBoundsTree*/ )(implicit ctx : Context ): Option [WildcardTypeTree ] = x match {
877
+ def matchWildcardTypeTree (x : TypeTree | TypeBoundsTree )(implicit ctx : Context ): Option [WildcardTypeTree ] = x match {
878
878
case x @ Trees .Ident (nme.WILDCARD ) => Some (x)
879
879
case _ => None
880
880
}
@@ -1119,7 +1119,7 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
1119
1119
def SymRef_qualifier (self : SymRef )(implicit ctx : Context ): TypeOrBounds = self.prefix
1120
1120
1121
1121
// TODO remove this method. May require splitting SymRef into TypeSymRef and TermSymRef
1122
- def matchSymRef_unapply (tpe : TypeOrBounds )(implicit ctx : Context ): Option [(Symbol , TypeOrBounds /* Type | NoPrefix */ )] = tpe match {
1122
+ def matchSymRef_unapply (tpe : TypeOrBounds )(implicit ctx : Context ): Option [(Symbol , Type | NoPrefix )] = tpe match {
1123
1123
case tpe : Types .NamedType =>
1124
1124
tpe.designator match {
1125
1125
case sym : Symbol => Some ((sym, tpe.prefix))
0 commit comments