From 50ba31dcc2da4cdfaf00548f9e6ca74599034570 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Fri, 29 Mar 2019 10:30:28 +0100 Subject: [PATCH 1/3] Rename TypeTree.{Ident|Select} to TypeTree.{TypeIdent|TypeSelect} --- .../tools/dotc/tastyreflect/KernelImpl.scala | 20 ++++---- .../other-new-features/tasty-reflect.md | 4 +- library/src/scala/tasty/reflect/Core.scala | 8 ++-- library/src/scala/tasty/reflect/Kernel.scala | 24 +++++----- .../src/scala/tasty/reflect/Printers.scala | 16 +++---- library/src/scala/tasty/reflect/TreeOps.scala | 48 +++++++++---------- .../src/scala/tasty/reflect/TreeUtils.scala | 10 ++-- .../dotty/semanticdb/SemanticdbConsumer.scala | 4 +- .../Yretain-trees/tasty-definitions-2.check | 4 +- .../Yretain-trees/tasty-load-tree-1.check | 4 +- tests/run-with-compiler/tasty-consumer.check | 8 ++-- tests/run/i5119.check | 2 +- tests/run/tasty-argument-tree-1.check | 2 +- tests/run/tasty-extractors-1.check | 40 ++++++++-------- tests/run/tasty-extractors-2.check | 44 ++++++++--------- 15 files changed, 119 insertions(+), 119 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/tastyreflect/KernelImpl.scala b/compiler/src/dotty/tools/dotc/tastyreflect/KernelImpl.scala index 80140e2d830c..792f61b4a3d4 100644 --- a/compiler/src/dotty/tools/dotc/tastyreflect/KernelImpl.scala +++ b/compiler/src/dotty/tools/dotc/tastyreflect/KernelImpl.scala @@ -658,32 +658,32 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util. def TypeTree_Inferred_apply(tpe: Type)(implicit ctx: Context): TypeTree_Inferred = withDefaultPos(ctx => tpd.TypeTree(tpe)(ctx)) - type TypeTree_Ident = tpd.Ident + type TypeTree_TypeIdent = tpd.Ident - def matchTypeTree_Ident(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[TypeTree_Ident] = tpt match { + def matchTypeTree_TypeIdent(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[TypeTree_TypeIdent] = tpt match { case tpt: tpd.Ident if tpt.isType => Some(tpt) case _ => None } - def TypeTree_Ident_name(self: TypeTree_Ident)(implicit ctx: Context): String = self.name.toString + def TypeTree_TypeIdent_name(self: TypeTree_TypeIdent)(implicit ctx: Context): String = self.name.toString - def TypeTree_Ident_copy(original: TypeTree_Ident)(name: String)(implicit ctx: Context): TypeTree_Ident = + def TypeTree_TypeIdent_copy(original: TypeTree_TypeIdent)(name: String)(implicit ctx: Context): TypeTree_TypeIdent = tpd.cpy.Ident(original)(name.toTypeName) - type TypeTree_Select = tpd.Select + type TypeTree_TypeSelect = tpd.Select - def matchTypeTree_Select(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[TypeTree_Select] = tpt match { + def matchTypeTree_TypeSelect(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[TypeTree_TypeSelect] = tpt match { case tpt: tpd.Select if tpt.isType && tpt.qualifier.isTerm => Some(tpt) case _ => None } - def TypeTree_Select_qualifier(self: TypeTree_Select)(implicit ctx: Context): Term = self.qualifier - def TypeTree_Select_name(self: TypeTree_Select)(implicit ctx: Context): String = self.name.toString + def TypeTree_TypeSelect_qualifier(self: TypeTree_TypeSelect)(implicit ctx: Context): Term = self.qualifier + def TypeTree_TypeSelect_name(self: TypeTree_TypeSelect)(implicit ctx: Context): String = self.name.toString - def TypeTree_Select_apply(qualifier: Term, name: String)(implicit ctx: Context): TypeTree_Select = + def TypeTree_TypeSelect_apply(qualifier: Term, name: String)(implicit ctx: Context): TypeTree_TypeSelect = withDefaultPos(ctx => tpd.Select(qualifier, name.toTypeName)(ctx)) - def TypeTree_Select_copy(original: TypeTree_Select)(qualifier: Term, name: String)(implicit ctx: Context): TypeTree_Select = + def TypeTree_TypeSelect_copy(original: TypeTree_TypeSelect)(qualifier: Term, name: String)(implicit ctx: Context): TypeTree_TypeSelect = tpd.cpy.Select(original)(qualifier, name.toTypeName) diff --git a/docs/docs/reference/other-new-features/tasty-reflect.md b/docs/docs/reference/other-new-features/tasty-reflect.md index 53d2fa98572d..a1795599c587 100644 --- a/docs/docs/reference/other-new-features/tasty-reflect.md +++ b/docs/docs/reference/other-new-features/tasty-reflect.md @@ -117,8 +117,8 @@ TASTy Reflect provides the following types: | +- While | +- TypeTree ----+- Synthetic - | +- Ident - | +- Select + | +- TypeIdent + | +- TypeSelect | +- Project | +- Singleton | +- Refined diff --git a/library/src/scala/tasty/reflect/Core.scala b/library/src/scala/tasty/reflect/Core.scala index 9da04014204f..0e6d458f9bbe 100644 --- a/library/src/scala/tasty/reflect/Core.scala +++ b/library/src/scala/tasty/reflect/Core.scala @@ -39,8 +39,8 @@ package scala.tasty.reflect * | * | * +- TypeTree ----+- Inferred - * | +- Ident - * | +- Select + * | +- TypeIdent + * | +- TypeSelect * | +- Project * | +- Singleton * | +- Refined @@ -250,10 +250,10 @@ trait Core { type Inferred = kernel.TypeTree_Inferred /** Type tree representing a reference to definition with a given name */ - type Ident = kernel.TypeTree_Ident + type TypeIdent = kernel.TypeTree_TypeIdent /** Type tree representing a selection of definition with a given name on a given term prefix */ - type Select = kernel.TypeTree_Select + type TypeSelect = kernel.TypeTree_TypeSelect /** Type tree representing a selection of definition with a given name on a given type prefix */ type Projection = kernel.TypeTree_Projection diff --git a/library/src/scala/tasty/reflect/Kernel.scala b/library/src/scala/tasty/reflect/Kernel.scala index 5e57eaa9427b..98db6d2035d5 100644 --- a/library/src/scala/tasty/reflect/Kernel.scala +++ b/library/src/scala/tasty/reflect/Kernel.scala @@ -38,8 +38,8 @@ package scala.tasty.reflect * | * | * +- TypeTree ----+- TypeTree_Inferred - * | +- TypeTree_Ident - * | +- TypeTree_Select + * | +- TypeTree_TypeIdent + * | +- TypeTree_TypeSelect * | +- TypeTree_Project * | +- TypeTree_Singleton * | +- TypeTree_Refined @@ -557,24 +557,24 @@ trait Kernel { def TypeTree_Inferred_apply(tpe: Type)(implicit ctx: Context): TypeTree_Inferred /** Type tree representing a reference to definition with a given name */ - type TypeTree_Ident <: TypeTree + type TypeTree_TypeIdent <: TypeTree - def matchTypeTree_Ident(tree: Tree)(implicit ctx: Context): Option[TypeTree_Ident] + def matchTypeTree_TypeIdent(tree: Tree)(implicit ctx: Context): Option[TypeTree_TypeIdent] - def TypeTree_Ident_name(self: TypeTree_Ident)(implicit ctx: Context): String + def TypeTree_TypeIdent_name(self: TypeTree_TypeIdent)(implicit ctx: Context): String - def TypeTree_Ident_copy(original: TypeTree_Ident)(name: String)(implicit ctx: Context): TypeTree_Ident + def TypeTree_TypeIdent_copy(original: TypeTree_TypeIdent)(name: String)(implicit ctx: Context): TypeTree_TypeIdent /** Type tree representing a selection of definition with a given name on a given term prefix */ - type TypeTree_Select <: TypeTree + type TypeTree_TypeSelect <: TypeTree - def matchTypeTree_Select(tree: Tree)(implicit ctx: Context): Option[TypeTree_Select] + def matchTypeTree_TypeSelect(tree: Tree)(implicit ctx: Context): Option[TypeTree_TypeSelect] - def TypeTree_Select_qualifier(self: TypeTree_Select)(implicit ctx: Context): Term - def TypeTree_Select_name(self: TypeTree_Select)(implicit ctx: Context): String + def TypeTree_TypeSelect_qualifier(self: TypeTree_TypeSelect)(implicit ctx: Context): Term + def TypeTree_TypeSelect_name(self: TypeTree_TypeSelect)(implicit ctx: Context): String - def TypeTree_Select_apply(qualifier: Term, name: String)(implicit ctx: Context): TypeTree_Select - def TypeTree_Select_copy(original: TypeTree_Select)(qualifier: Term, name: String)(implicit ctx: Context): TypeTree_Select + def TypeTree_TypeSelect_apply(qualifier: Term, name: String)(implicit ctx: Context): TypeTree_TypeSelect + def TypeTree_TypeSelect_copy(original: TypeTree_TypeSelect)(qualifier: Term, name: String)(implicit ctx: Context): TypeTree_TypeSelect /** Type tree representing a selection of definition with a given name on a given type prefix */ type TypeTree_Projection <: TypeTree diff --git a/library/src/scala/tasty/reflect/Printers.scala b/library/src/scala/tasty/reflect/Printers.scala index 4c731578a5b1..05ead29502cd 100644 --- a/library/src/scala/tasty/reflect/Printers.scala +++ b/library/src/scala/tasty/reflect/Printers.scala @@ -211,10 +211,10 @@ trait Printers this += "PackageClause(" += pid += ", " ++= stats += ")" case TypeTree.Inferred() => this += "TypeTree.Inferred()" - case TypeTree.Ident(name) => - this += "TypeTree.Ident(\"" += name += "\")" - case TypeTree.Select(qualifier, name) => - this += "TypeTree.Select(" += qualifier += ", \"" += name += "\")" + case TypeTree.TypeIdent(name) => + this += "TypeTree.TypeIdent(\"" += name += "\")" + case TypeTree.TypeSelect(qualifier, name) => + this += "TypeTree.TypeSelect(" += qualifier += ", \"" += name += "\")" case TypeTree.Projection(qualifier, name) => this += "TypeTree.Projection(" += qualifier += ", \"" += name += "\")" case TypeTree.Singleton(ref) => @@ -575,8 +575,8 @@ trait Printers val parents1 = parents.filter { case IsTerm(Term.Apply(Term.Select(Term.New(tpt), _), _)) => !Types.JavaLangObject.unapply(tpt.tpe) - case IsTypeTree(TypeTree.Select(Term.Select(Term.Ident("_root_"), "scala"), "Product")) => false - case IsTypeTree(TypeTree.Select(Term.Select(Term.Ident("_root_"), "scala"), "Serializable")) => false + case IsTypeTree(TypeTree.TypeSelect(Term.Select(Term.Ident("_root_"), "scala"), "Product")) => false + case IsTypeTree(TypeTree.TypeSelect(Term.Select(Term.Ident("_root_"), "scala"), "Serializable")) => false case _ => true } if (parents1.nonEmpty) @@ -1389,10 +1389,10 @@ trait Printers } printTypeAndAnnots(tree.tpe) - case TypeTree.Ident(name) => + case TypeTree.TypeIdent(name) => printType(tree.tpe) - case TypeTree.Select(qual, name) => + case TypeTree.TypeSelect(qual, name) => printTree(qual) += "." += highlightTypeDef(name, color) case TypeTree.Projection(qual, name) => diff --git a/library/src/scala/tasty/reflect/TreeOps.scala b/library/src/scala/tasty/reflect/TreeOps.scala index 9c967a7dfa3e..3b3ea80b1d63 100644 --- a/library/src/scala/tasty/reflect/TreeOps.scala +++ b/library/src/scala/tasty/reflect/TreeOps.scala @@ -793,33 +793,33 @@ trait TreeOps extends Core { kernel.matchTypeTree_Inferred(tree).isDefined } - object IsIdent { - /** Matches any Ident and returns it */ - def unapply(tree: Tree)(implicit ctx: Context): Option[Ident] = - kernel.matchTypeTree_Ident(tree) + object IsTypeIdent { + /** Matches any TypeIdent and returns it */ + def unapply(tree: Tree)(implicit ctx: Context): Option[TypeIdent] = + kernel.matchTypeTree_TypeIdent(tree) } - object Ident { - // TODO def apply(name: String)(implicit ctx: Context): Ident - def copy(original: Ident)(name: String)(implicit ctx: Context): Ident = - kernel.TypeTree_Ident_copy(original)(name) + object TypeIdent { + // TODO def apply(name: String)(implicit ctx: Context): TypeIdent + def copy(original: TypeIdent)(name: String)(implicit ctx: Context): TypeIdent = + kernel.TypeTree_TypeIdent_copy(original)(name) def unapply(tree: Tree)(implicit ctx: Context): Option[String] = - kernel.matchTypeTree_Ident(tree).map(_.name) + kernel.matchTypeTree_TypeIdent(tree).map(_.name) } - object IsSelect { - /** Matches any Select and returns it */ - def unapply(tree: Tree)(implicit ctx: Context): Option[Select] = - kernel.matchTypeTree_Select(tree) + object IsTypeSelect { + /** Matches any TypeSelect and returns it */ + def unapply(tree: Tree)(implicit ctx: Context): Option[TypeSelect] = + kernel.matchTypeTree_TypeSelect(tree) } - object Select { - def apply(qualifier: Term, name: String)(implicit ctx: Context): Select = - kernel.TypeTree_Select_apply(qualifier, name) - def copy(original: Select)(qualifier: Term, name: String)(implicit ctx: Context): Select = - kernel.TypeTree_Select_copy(original)(qualifier, name) + object TypeSelect { + def apply(qualifier: Term, name: String)(implicit ctx: Context): TypeSelect = + kernel.TypeTree_TypeSelect_apply(qualifier, name) + def copy(original: TypeSelect)(qualifier: Term, name: String)(implicit ctx: Context): TypeSelect = + kernel.TypeTree_TypeSelect_copy(original)(qualifier, name) def unapply(tree: Tree)(implicit ctx: Context): Option[(Term, String)] = - kernel.matchTypeTree_Select(tree).map(x => (x.qualifier, x.name)) + kernel.matchTypeTree_TypeSelect(tree).map(x => (x.qualifier, x.name)) } object IsProjection { @@ -970,13 +970,13 @@ trait TreeOps extends Core { } } - implicit class TypeTree_IdentAPI(self: TypeTree.Ident) { - def name(implicit ctx: Context): String = kernel.TypeTree_Ident_name(self) + implicit class TypeTree_TypeIdentAPI(self: TypeTree.TypeIdent) { + def name(implicit ctx: Context): String = kernel.TypeTree_TypeIdent_name(self) } - implicit class TypeTree_SelectAPI(self: TypeTree.Select) { - def qualifier(implicit ctx: Context): Term = kernel.TypeTree_Select_qualifier(self) - def name(implicit ctx: Context): String = kernel.TypeTree_Select_name(self) + implicit class TypeTree_TypeSelectAPI(self: TypeTree.TypeSelect) { + def qualifier(implicit ctx: Context): Term = kernel.TypeTree_TypeSelect_qualifier(self) + def name(implicit ctx: Context): String = kernel.TypeTree_TypeSelect_name(self) } implicit class TypeTree_ProjectionAPI(self: TypeTree.Projection) { diff --git a/library/src/scala/tasty/reflect/TreeUtils.scala b/library/src/scala/tasty/reflect/TreeUtils.scala index 3d0a772b6c57..865c0850910f 100644 --- a/library/src/scala/tasty/reflect/TreeUtils.scala +++ b/library/src/scala/tasty/reflect/TreeUtils.scala @@ -76,8 +76,8 @@ trait TreeUtils case IsPackageClause(clause @ PackageClause(pid, stats)) => foldTrees(foldTree(x, pid), stats)(clause.symbol.localContext) case TypeTree.Inferred() => x - case TypeTree.Ident(_) => x - case TypeTree.Select(qualifier, _) => foldTree(x, qualifier) + case TypeTree.TypeIdent(_) => x + case TypeTree.TypeSelect(qualifier, _) => foldTree(x, qualifier) case TypeTree.Projection(qualifier, _) => foldTree(x, qualifier) case TypeTree.Singleton(ref) => foldTree(x, ref) case TypeTree.Refined(tpt, refinements) => foldTrees(foldTree(x, tpt), refinements) @@ -209,9 +209,9 @@ trait TreeUtils def transformTypeTree(tree: TypeTree)(implicit ctx: Context): TypeTree = tree match { case TypeTree.Inferred() => tree - case TypeTree.IsIdent(tree) => tree - case TypeTree.IsSelect(tree) => - TypeTree.Select.copy(tree)(tree.qualifier, tree.name) + case TypeTree.IsTypeIdent(tree) => tree + case TypeTree.IsTypeSelect(tree) => + TypeTree.TypeSelect.copy(tree)(tree.qualifier, tree.name) case TypeTree.IsProjection(tree) => TypeTree.Projection.copy(tree)(tree.qualifier, tree.name) case TypeTree.IsAnnotated(tree) => diff --git a/semanticdb/src/dotty/semanticdb/SemanticdbConsumer.scala b/semanticdb/src/dotty/semanticdb/SemanticdbConsumer.scala index 9535e3ef408c..9402ea7006e1 100644 --- a/semanticdb/src/dotty/semanticdb/SemanticdbConsumer.scala +++ b/semanticdb/src/dotty/semanticdb/SemanticdbConsumer.scala @@ -634,13 +634,13 @@ class SemanticdbConsumer(sourceFilePath: java.nio.file.Path) extends TastyConsum def traverseTypeTree(tree: Tree /*TypeTree | TypeBoundsTree*/)( implicit ctx: Context): Unit = { tree match { - case TypeTree.Ident(_) => { + case TypeTree.TypeIdent(_) => { val typetree = tree.typetree addOccurenceTypeTree(typetree, s.SymbolOccurrence.Role.REFERENCE, createRange(typetree.pos)) } - case TypeTree.Select(qualifier, _) => { + case TypeTree.TypeSelect(qualifier, _) => { val typetree = tree.typetree val range = rangeSelect(typetree.symbol.trueName, typetree.pos) addOccurenceTypeTree(typetree, diff --git a/tests/run-custom-args/Yretain-trees/tasty-definitions-2.check b/tests/run-custom-args/Yretain-trees/tasty-definitions-2.check index a67242c349e8..299dbdade381 100644 --- a/tests/run-custom-args/Yretain-trees/tasty-definitions-2.check +++ b/tests/run-custom-args/Yretain-trees/tasty-definitions-2.check @@ -1,3 +1,3 @@ -DefDef("foo", Nil, Nil, TypeTree.Ident("Int"), Some(Term.Apply(Term.Select(Term.Literal(Constant.Int(1)), "+"), List(Term.Literal(Constant.Int(2)))))) -ValDef("bar", TypeTree.Ident("Int"), Some(Term.Apply(Term.Select(Term.Literal(Constant.Int(2)), "+"), List(Term.Literal(Constant.Int(3)))))) +DefDef("foo", Nil, Nil, TypeTree.TypeIdent("Int"), Some(Term.Apply(Term.Select(Term.Literal(Constant.Int(1)), "+"), List(Term.Literal(Constant.Int(2)))))) +ValDef("bar", TypeTree.TypeIdent("Int"), Some(Term.Apply(Term.Select(Term.Literal(Constant.Int(2)), "+"), List(Term.Literal(Constant.Int(3)))))) Pattern.Bind("x", Pattern.Value(Term.Ident("_"))) diff --git a/tests/run-custom-args/Yretain-trees/tasty-load-tree-1.check b/tests/run-custom-args/Yretain-trees/tasty-load-tree-1.check index fa4dada79aef..3f3af8dda9f9 100644 --- a/tests/run-custom-args/Yretain-trees/tasty-load-tree-1.check +++ b/tests/run-custom-args/Yretain-trees/tasty-load-tree-1.check @@ -1,2 +1,2 @@ -DefDef("foo", Nil, Nil, TypeTree.Ident("Int"), Some(Term.Apply(Term.Select(Term.Literal(Constant.Int(1)), "+"), List(Term.Literal(Constant.Int(2)))))) -ValDef("bar", TypeTree.Ident("Int"), Some(Term.Apply(Term.Select(Term.Literal(Constant.Int(2)), "+"), List(Term.Literal(Constant.Int(3)))))) +DefDef("foo", Nil, Nil, TypeTree.TypeIdent("Int"), Some(Term.Apply(Term.Select(Term.Literal(Constant.Int(1)), "+"), List(Term.Literal(Constant.Int(2)))))) +ValDef("bar", TypeTree.TypeIdent("Int"), Some(Term.Apply(Term.Select(Term.Literal(Constant.Int(2)), "+"), List(Term.Literal(Constant.Int(3)))))) diff --git a/tests/run-with-compiler/tasty-consumer.check b/tests/run-with-compiler/tasty-consumer.check index b73593445b16..9be2bf328868 100644 --- a/tests/run-with-compiler/tasty-consumer.check +++ b/tests/run-with-compiler/tasty-consumer.check @@ -1,5 +1,5 @@ -ClassDef("Foo", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(ValDef("foo", TypeTree.Ident("Int"), Some(Term.Literal(Constant.Int(2)))), DefDef("bar", Nil, List(List(ValDef("i", TypeTree.Ident("Int"), None))), TypeTree.Ident("Int"), Some(Term.Literal(Constant.Int(3)))))) +ClassDef("Foo", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(ValDef("foo", TypeTree.TypeIdent("Int"), Some(Term.Literal(Constant.Int(2)))), DefDef("bar", Nil, List(List(ValDef("i", TypeTree.TypeIdent("Int"), None))), TypeTree.TypeIdent("Int"), Some(Term.Literal(Constant.Int(3)))))) DefDef("", Nil, List(Nil), TypeTree.Inferred(), None) -ValDef("foo", TypeTree.Ident("Int"), Some(Term.Literal(Constant.Int(2)))) -DefDef("bar", Nil, List(List(ValDef("i", TypeTree.Ident("Int"), None))), TypeTree.Ident("Int"), Some(Term.Literal(Constant.Int(3)))) -ValDef("i", TypeTree.Ident("Int"), None) +ValDef("foo", TypeTree.TypeIdent("Int"), Some(Term.Literal(Constant.Int(2)))) +DefDef("bar", Nil, List(List(ValDef("i", TypeTree.TypeIdent("Int"), None))), TypeTree.TypeIdent("Int"), Some(Term.Literal(Constant.Int(3)))) +ValDef("i", TypeTree.TypeIdent("Int"), None) diff --git a/tests/run/i5119.check b/tests/run/i5119.check index d290fd4fda6a..b4a7f4d64db1 100644 --- a/tests/run/i5119.check +++ b/tests/run/i5119.check @@ -1,2 +1,2 @@ -Term.Select(Term.Typed(Term.Apply(Term.Select(Term.New(TypeTree.Ident("StringContextOps")), ""), List(Term.Apply(Term.Select(Term.Select(Term.Select(Term.Ident("_root_"), "scala"), "StringContext"), "apply"), List(Term.Typed(Term.Repeated(List(Term.Literal(Constant.String("Hello World ")), Term.Literal(Constant.String("!"))), TypeTree.Inferred()), TypeTree.Inferred()))))), TypeTree.Ident("StringContextOps")), "inline$sc") +Term.Select(Term.Typed(Term.Apply(Term.Select(Term.New(TypeTree.TypeIdent("StringContextOps")), ""), List(Term.Apply(Term.Select(Term.Select(Term.Select(Term.Ident("_root_"), "scala"), "StringContext"), "apply"), List(Term.Typed(Term.Repeated(List(Term.Literal(Constant.String("Hello World ")), Term.Literal(Constant.String("!"))), TypeTree.Inferred()), TypeTree.Inferred()))))), TypeTree.TypeIdent("StringContextOps")), "inline$sc") Term.Typed(Term.Repeated(List(Term.Literal(Constant.Int(1))), TypeTree.Inferred()), TypeTree.Inferred()) diff --git a/tests/run/tasty-argument-tree-1.check b/tests/run/tasty-argument-tree-1.check index d631c0cbda2f..fa0be0ec8113 100644 --- a/tests/run/tasty-argument-tree-1.check +++ b/tests/run/tasty-argument-tree-1.check @@ -24,7 +24,7 @@ tree: Term.Inlined(None, Nil, Term.Ident("x")) tree deref. vals: Term.Apply(Term.Ident("d3"), List(Term.Literal(Constant.Int(3)))) tree: Term.Inlined(None, Nil, Term.Ident("x")) -tree deref. vals: Term.TypeApply(Term.Ident("d4"), List(TypeTree.Ident("Int"))) +tree deref. vals: Term.TypeApply(Term.Ident("d4"), List(TypeTree.TypeIdent("Int"))) tree: Term.Inlined(None, Nil, Term.Ident("vv")) tree deref. vals: Term.Literal(Constant.Int(1)) diff --git a/tests/run/tasty-extractors-1.check b/tests/run/tasty-extractors-1.check index 36ddc8f2f20e..feaf2e1cc5f4 100644 --- a/tests/run/tasty-extractors-1.check +++ b/tests/run/tasty-extractors-1.check @@ -19,13 +19,13 @@ Type.ConstantType(Constant.String("abc")) Term.Inlined(None, Nil, Term.Apply(Term.Ident("println"), List(Term.Literal(Constant.String("abc"))))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Typed(Term.Literal(Constant.Int(8)), TypeTree.Ident("Int"))) +Term.Inlined(None, Nil, Term.Typed(Term.Literal(Constant.Int(8)), TypeTree.TypeIdent("Int"))) Type.SymRef(IsClassDefSymbol(), Type.SymRef(IsPackageDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(<>), NoPrefix())))) -Term.Inlined(None, Nil, Term.Typed(Term.Literal(Constant.Byte(8)), TypeTree.Ident("Byte"))) +Term.Inlined(None, Nil, Term.Typed(Term.Literal(Constant.Byte(8)), TypeTree.TypeIdent("Byte"))) Type.SymRef(IsClassDefSymbol(), Type.SymRef(IsPackageDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(<>), NoPrefix())))) -Term.Inlined(None, Nil, Term.Typed(Term.Literal(Constant.Short(8)), TypeTree.Ident("Short"))) +Term.Inlined(None, Nil, Term.Typed(Term.Literal(Constant.Short(8)), TypeTree.TypeIdent("Short"))) Type.SymRef(IsClassDefSymbol(), Type.SymRef(IsPackageDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(<>), NoPrefix())))) Term.Inlined(None, Nil, Term.Literal(Constant.Char(a))) @@ -34,7 +34,7 @@ Type.ConstantType(Constant.Char(a)) Term.Inlined(None, Nil, Term.Block(List(Term.Literal(Constant.Int(1)), Term.Literal(Constant.Int(2))), Term.Literal(Constant.Int(3)))) Type.ConstantType(Constant.Int(3)) -Term.Inlined(None, Nil, Term.If(Term.Typed(Term.Literal(Constant.Boolean(true)), TypeTree.Ident("Boolean")), Term.Literal(Constant.Int(1)), Term.Literal(Constant.Int(2)))) +Term.Inlined(None, Nil, Term.If(Term.Typed(Term.Literal(Constant.Boolean(true)), TypeTree.TypeIdent("Boolean")), Term.Literal(Constant.Int(1)), Term.Literal(Constant.Int(2)))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) Term.Inlined(None, Nil, Term.Match(Term.Literal(Constant.String("a")), List(CaseDef(Pattern.Value(Term.Literal(Constant.String("a"))), None, Term.Block(Nil, Term.Literal(Constant.Unit())))))) @@ -43,16 +43,16 @@ Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageD Term.Inlined(None, Nil, Term.Match(Term.Literal(Constant.String("b")), List(CaseDef(Pattern.Bind("n", Pattern.Value(Term.Ident("_"))), None, Term.Block(Nil, Term.Literal(Constant.Unit())))))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Match(Term.Literal(Constant.String("c")), List(CaseDef(Pattern.Bind("n", Pattern.TypeTest(TypeTree.Ident("String"))), None, Term.Block(Nil, Term.Literal(Constant.Unit())))))) +Term.Inlined(None, Nil, Term.Match(Term.Literal(Constant.String("c")), List(CaseDef(Pattern.Bind("n", Pattern.TypeTest(TypeTree.TypeIdent("String"))), None, Term.Block(Nil, Term.Literal(Constant.Unit())))))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) Term.Inlined(None, Nil, Term.Match(Term.Literal(Constant.String("e")), List(CaseDef(Pattern.Value(Term.Ident("_")), None, Term.Block(Nil, Term.Literal(Constant.Unit())))))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Match(Term.Literal(Constant.String("f")), List(CaseDef(Pattern.TypeTest(TypeTree.Ident("String")), None, Term.Block(Nil, Term.Literal(Constant.Unit())))))) +Term.Inlined(None, Nil, Term.Match(Term.Literal(Constant.String("f")), List(CaseDef(Pattern.TypeTest(TypeTree.TypeIdent("String")), None, Term.Block(Nil, Term.Literal(Constant.Unit())))))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Match(Term.Typed(Term.Literal(Constant.String("g")), TypeTree.Ident("Any")), List(CaseDef(Pattern.Alternative(List(Pattern.TypeTest(TypeTree.Ident("String")), Pattern.TypeTest(TypeTree.Ident("Int")))), None, Term.Block(Nil, Term.Literal(Constant.Unit())))))) +Term.Inlined(None, Nil, Term.Match(Term.Typed(Term.Literal(Constant.String("g")), TypeTree.TypeIdent("Any")), List(CaseDef(Pattern.Alternative(List(Pattern.TypeTest(TypeTree.TypeIdent("String")), Pattern.TypeTest(TypeTree.TypeIdent("Int")))), None, Term.Block(Nil, Term.Literal(Constant.Unit())))))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) Term.Inlined(None, Nil, Term.Match(Term.Literal(Constant.String("h")), List(CaseDef(Pattern.Value(Term.Ident("_")), Some(Term.Literal(Constant.Boolean(false))), Term.Block(Nil, Term.Literal(Constant.Unit())))))) @@ -76,45 +76,45 @@ Type.OrType(Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef Term.Inlined(None, Nil, Term.Apply(Term.Select(Term.Literal(Constant.String("a")), "=="), List(Term.Literal(Constant.String("b"))))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Apply(Term.Select(Term.New(TypeTree.Ident("Object")), ""), Nil)) +Term.Inlined(None, Nil, Term.Apply(Term.Select(Term.New(TypeTree.TypeIdent("Object")), ""), Nil)) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) Term.Inlined(None, Nil, Term.Apply(Term.Select(Term.Ident("Int"), "box"), List(Term.NamedArg("x", Term.Literal(Constant.Int(9)))))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Apply(Term.TypeApply(Term.Select(Term.Ident("Ordering"), "apply"), List(TypeTree.Ident("Int"))), List(Term.Ident("Int")))) +Term.Inlined(None, Nil, Term.Apply(Term.TypeApply(Term.Select(Term.Ident("Ordering"), "apply"), List(TypeTree.TypeIdent("Int"))), List(Term.Ident("Int")))) Type.AppliedType(Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))), List(Type.SymRef(IsClassDefSymbol(), Type.SymRef(IsPackageDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(<>), NoPrefix())))))) -Term.Inlined(None, Nil, Term.Block(List(ValDef("a", TypeTree.Ident("Int"), Some(Term.Literal(Constant.Int(3))))), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(ValDef("a", TypeTree.TypeIdent("Int"), Some(Term.Literal(Constant.Int(3))))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(ValDef("b", TypeTree.Ident("Int"), Some(Term.Literal(Constant.Int(3))))), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(ValDef("b", TypeTree.TypeIdent("Int"), Some(Term.Literal(Constant.Int(3))))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(DefDef("f1", Nil, Nil, TypeTree.Ident("Int"), Some(Term.Literal(Constant.Int(3))))), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(DefDef("f1", Nil, Nil, TypeTree.TypeIdent("Int"), Some(Term.Literal(Constant.Int(3))))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(DefDef("f2", Nil, Nil, TypeTree.Ident("Int"), Some(Term.Return(Term.Literal(Constant.Int(4)))))), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(DefDef("f2", Nil, Nil, TypeTree.TypeIdent("Int"), Some(Term.Return(Term.Literal(Constant.Int(4)))))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(DefDef("f3", Nil, List(List(ValDef("i", TypeTree.Ident("Int"), None))), TypeTree.Ident("Int"), Some(Term.Ident("i")))), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(DefDef("f3", Nil, List(List(ValDef("i", TypeTree.TypeIdent("Int"), None))), TypeTree.TypeIdent("Int"), Some(Term.Ident("i")))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(DefDef("f4", Nil, List(List(ValDef("i", TypeTree.Ident("Int"), None)), List(ValDef("j", TypeTree.Ident("Int"), None))), TypeTree.Ident("Int"), Some(Term.Apply(Term.Select(Term.Ident("i"), "+"), List(Term.Ident("j")))))), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(DefDef("f4", Nil, List(List(ValDef("i", TypeTree.TypeIdent("Int"), None)), List(ValDef("j", TypeTree.TypeIdent("Int"), None))), TypeTree.TypeIdent("Int"), Some(Term.Apply(Term.Select(Term.Ident("i"), "+"), List(Term.Ident("j")))))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(DefDef("f5", Nil, List(List(ValDef("i", TypeTree.Ident("Int"), None))), TypeTree.Ident("Int"), Some(Term.Ident("i"))), DefDef("f5$default$1", Nil, Nil, TypeTree.Inferred(), Some(Term.Literal(Constant.Int(9))))), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(DefDef("f5", Nil, List(List(ValDef("i", TypeTree.TypeIdent("Int"), None))), TypeTree.TypeIdent("Int"), Some(Term.Ident("i"))), DefDef("f5$default$1", Nil, Nil, TypeTree.Inferred(), Some(Term.Literal(Constant.Int(9))))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(DefDef("f6", List(TypeDef("T", TypeBoundsTree(TypeTree.Inferred(), TypeTree.Inferred()))), List(List(ValDef("x", TypeTree.Ident("T"), None))), TypeTree.Ident("T"), Some(Term.Ident("x")))), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(DefDef("f6", List(TypeDef("T", TypeBoundsTree(TypeTree.Inferred(), TypeTree.Inferred()))), List(List(ValDef("x", TypeTree.TypeIdent("T"), None))), TypeTree.TypeIdent("T"), Some(Term.Ident("x")))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(DefDef("f7", List(TypeDef("T", TypeBoundsTree(TypeTree.Inferred(), TypeTree.Inferred()))), List(List(ValDef("x", TypeTree.Ident("T"), None))), TypeTree.Singleton(Term.Ident("x")), Some(Term.Ident("x")))), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(DefDef("f7", List(TypeDef("T", TypeBoundsTree(TypeTree.Inferred(), TypeTree.Inferred()))), List(List(ValDef("x", TypeTree.TypeIdent("T"), None))), TypeTree.Singleton(Term.Ident("x")), Some(Term.Ident("x")))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(DefDef("f8", Nil, List(List(ValDef("i", TypeTree.Annotated(TypeTree.Applied(TypeTree.Inferred(), List(TypeTree.Ident("Int"))), Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), None))), TypeTree.Ident("Int"), Some(Term.Literal(Constant.Int(9))))), Term.Apply(Term.Ident("f8"), List(Term.Typed(Term.Repeated(List(Term.Literal(Constant.Int(1)), Term.Literal(Constant.Int(2)), Term.Literal(Constant.Int(3))), TypeTree.Inferred()), TypeTree.Inferred()))))) +Term.Inlined(None, Nil, Term.Block(List(DefDef("f8", Nil, List(List(ValDef("i", TypeTree.Annotated(TypeTree.Applied(TypeTree.Inferred(), List(TypeTree.TypeIdent("Int"))), Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), None))), TypeTree.TypeIdent("Int"), Some(Term.Literal(Constant.Int(9))))), Term.Apply(Term.Ident("f8"), List(Term.Typed(Term.Repeated(List(Term.Literal(Constant.Int(1)), Term.Literal(Constant.Int(2)), Term.Literal(Constant.Int(3))), TypeTree.Inferred()), TypeTree.Inferred()))))) Type.SymRef(IsClassDefSymbol(), Type.SymRef(IsPackageDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(<>), NoPrefix())))) -Term.Inlined(None, Nil, Term.Block(List(DefDef("f9", Nil, List(List(ValDef("i", TypeTree.ByName(TypeTree.Ident("Int")), None))), TypeTree.Ident("Int"), Some(Term.Ident("i")))), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(DefDef("f9", Nil, List(List(ValDef("i", TypeTree.ByName(TypeTree.TypeIdent("Int")), None))), TypeTree.TypeIdent("Int"), Some(Term.Ident("i")))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) diff --git a/tests/run/tasty-extractors-2.check b/tests/run/tasty-extractors-2.check index 7dcbd9fbae84..f613539862ee 100644 --- a/tests/run/tasty-extractors-2.check +++ b/tests/run/tasty-extractors-2.check @@ -1,7 +1,7 @@ Term.Inlined(None, Nil, Term.Block(List(ValDef("x", TypeTree.Inferred(), Some(Term.Literal(Constant.Int(1))))), Term.Assign(Term.Ident("x"), Term.Literal(Constant.Int(2))))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(DefDef("$anonfun", Nil, List(List(ValDef("x", TypeTree.Ident("Int"), None))), TypeTree.Inferred(), Some(Term.Ident("x")))), Term.Lambda(Term.Ident("$anonfun"), None))) +Term.Inlined(None, Nil, Term.Block(List(DefDef("$anonfun", Nil, List(List(ValDef("x", TypeTree.TypeIdent("Int"), None))), TypeTree.Inferred(), Some(Term.Ident("x")))), Term.Lambda(Term.Ident("$anonfun"), None))) Type.AppliedType(Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))), List(Type.SymRef(IsClassDefSymbol(), Type.SymRef(IsPackageDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(<>), NoPrefix())))), Type.SymRef(IsClassDefSymbol(), Type.SymRef(IsPackageDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(<>), NoPrefix())))))) Term.Inlined(None, Nil, Term.Ident("???")) @@ -10,31 +10,31 @@ Type.SymRef(IsDefDefSymbol(), Type.SymRef(IsValDefSymbol(), Type.SymRef(IsPackageDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(<>), NoPrefix())))) -Term.Inlined(None, Nil, Term.Typed(Term.Ident("Nil"), TypeTree.Applied(TypeTree.Ident("List"), List(TypeTree.Ident("Int"))))) +Term.Inlined(None, Nil, Term.Typed(Term.Ident("Nil"), TypeTree.Applied(TypeTree.TypeIdent("List"), List(TypeTree.TypeIdent("Int"))))) Type.AppliedType(Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))), List(Type.SymRef(IsClassDefSymbol(), Type.SymRef(IsPackageDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(<>), NoPrefix())))))) -Term.Inlined(None, Nil, Term.Typed(Term.Apply(Term.Select(Term.New(TypeTree.Ident("Baz")), ""), Nil), TypeTree.Applied(TypeTree.Ident("&"), List(TypeTree.Ident("Foo"), TypeTree.Ident("Bar"))))) +Term.Inlined(None, Nil, Term.Typed(Term.Apply(Term.Select(Term.New(TypeTree.TypeIdent("Baz")), ""), Nil), TypeTree.Applied(TypeTree.TypeIdent("&"), List(TypeTree.TypeIdent("Foo"), TypeTree.TypeIdent("Bar"))))) Type.AndType(Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(<>), NoPrefix()))), Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(<>), NoPrefix())))) -Term.Inlined(None, Nil, Term.Typed(Term.Literal(Constant.Int(1)), TypeTree.Applied(TypeTree.Ident("|"), List(TypeTree.Ident("Int"), TypeTree.Ident("String"))))) +Term.Inlined(None, Nil, Term.Typed(Term.Literal(Constant.Int(1)), TypeTree.Applied(TypeTree.TypeIdent("|"), List(TypeTree.TypeIdent("Int"), TypeTree.TypeIdent("String"))))) Type.OrType(Type.SymRef(IsClassDefSymbol(), Type.SymRef(IsPackageDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(<>), NoPrefix())))), Type.SymRef(IsTypeDefSymbol(), Type.SymRef(IsValDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))))) Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, Nil)), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(ValDef("Foo", TypeTree.Ident("Foo$"), Some(Term.Apply(Term.Select(Term.New(TypeTree.Ident("Foo$")), ""), Nil))), ClassDef("Foo$", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil), TypeTree.Select(Term.Select(Term.Ident("_root_"), "scala"), "Serializable")), Nil, Some(ValDef("_", TypeTree.Singleton(Term.Ident("Foo")), None)), Nil)), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(ValDef("Foo", TypeTree.TypeIdent("Foo$"), Some(Term.Apply(Term.Select(Term.New(TypeTree.TypeIdent("Foo$")), ""), Nil))), ClassDef("Foo$", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil), TypeTree.TypeSelect(Term.Select(Term.Ident("_root_"), "scala"), "Serializable")), Nil, Some(ValDef("_", TypeTree.Singleton(Term.Ident("Foo")), None)), Nil)), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) Term.Inlined(None, Nil, Term.Block(List(TypeDef("Foo", TypeBoundsTree(TypeTree.Inferred(), TypeTree.Inferred()))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(TypeDef("Foo", TypeTree.Ident("Int"))), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(TypeDef("Foo", TypeTree.TypeIdent("Int"))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(TypeDef("Foo", TypeBoundsTree(TypeTree.Ident("Null"), TypeTree.Ident("Object")))), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(TypeDef("Foo", TypeBoundsTree(TypeTree.TypeIdent("Null"), TypeTree.TypeIdent("Object")))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(ValDef("a", TypeTree.Inferred(), Some(Term.Literal(Constant.Int(0)))), DefDef("a_=", Nil, List(List(ValDef("x$1", TypeTree.Inferred(), None))), TypeTree.Inferred(), Some(Term.Literal(Constant.Unit())))))), Term.Literal(Constant.Unit()))) @@ -49,28 +49,28 @@ Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageD Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(DefDef("a", Nil, Nil, TypeTree.Inferred(), Some(Term.Literal(Constant.Int(0))))))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil), TypeTree.Select(Term.Select(Term.Ident("_root_"), "scala"), "Product"), TypeTree.Select(Term.Select(Term.Ident("_root_"), "scala"), "Serializable")), Nil, None, List(DefDef("productElementName", Nil, List(List(ValDef("x$1", TypeTree.Select(Term.Select(Term.Ident("_root_"), "scala"), "Int"), None))), TypeTree.Select(Term.Select(Term.Ident("java"), "lang"), "String"), Some(Term.Match(Term.Ident("x$1"), List(CaseDef(Pattern.Value(Term.Ident("_")), None, Term.Apply(Term.Ident("throw"), List(Term.Apply(Term.Select(Term.New(TypeTree.Select(Term.Select(Term.Ident("java"), "lang"), "IndexOutOfBoundsException")), ""), List(Term.Apply(Term.Select(Term.Select(Term.Select(Term.Ident("java"), "lang"), "String"), "valueOf"), List(Term.Ident("x$1")))))))))))), DefDef("copy", Nil, List(Nil), TypeTree.Inferred(), Some(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil))))), ValDef("Foo", TypeTree.Ident("Foo$"), Some(Term.Apply(Term.Select(Term.New(TypeTree.Ident("Foo$")), ""), Nil))), ClassDef("Foo$", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil), TypeTree.Applied(TypeTree.Inferred(), List(TypeTree.Inferred())), TypeTree.Select(Term.Select(Term.Ident("_root_"), "scala"), "Serializable")), Nil, Some(ValDef("_", TypeTree.Singleton(Term.Ident("Foo")), None)), List(DefDef("apply", Nil, List(Nil), TypeTree.Inferred(), Some(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil))), DefDef("unapply", Nil, List(List(ValDef("x$1", TypeTree.Inferred(), None))), TypeTree.Inferred(), Some(Term.Literal(Constant.Boolean(true))))))), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil), TypeTree.TypeSelect(Term.Select(Term.Ident("_root_"), "scala"), "Product"), TypeTree.TypeSelect(Term.Select(Term.Ident("_root_"), "scala"), "Serializable")), Nil, None, List(DefDef("productElementName", Nil, List(List(ValDef("x$1", TypeTree.TypeSelect(Term.Select(Term.Ident("_root_"), "scala"), "Int"), None))), TypeTree.TypeSelect(Term.Select(Term.Ident("java"), "lang"), "String"), Some(Term.Match(Term.Ident("x$1"), List(CaseDef(Pattern.Value(Term.Ident("_")), None, Term.Apply(Term.Ident("throw"), List(Term.Apply(Term.Select(Term.New(TypeTree.TypeSelect(Term.Select(Term.Ident("java"), "lang"), "IndexOutOfBoundsException")), ""), List(Term.Apply(Term.Select(Term.Select(Term.Select(Term.Ident("java"), "lang"), "String"), "valueOf"), List(Term.Ident("x$1")))))))))))), DefDef("copy", Nil, List(Nil), TypeTree.Inferred(), Some(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil))))), ValDef("Foo", TypeTree.TypeIdent("Foo$"), Some(Term.Apply(Term.Select(Term.New(TypeTree.TypeIdent("Foo$")), ""), Nil))), ClassDef("Foo$", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil), TypeTree.Applied(TypeTree.Inferred(), List(TypeTree.Inferred())), TypeTree.TypeSelect(Term.Select(Term.Ident("_root_"), "scala"), "Serializable")), Nil, Some(ValDef("_", TypeTree.Singleton(Term.Ident("Foo")), None)), List(DefDef("apply", Nil, List(Nil), TypeTree.Inferred(), Some(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil))), DefDef("unapply", Nil, List(List(ValDef("x$1", TypeTree.Inferred(), None))), TypeTree.Inferred(), Some(Term.Literal(Constant.Boolean(true))))))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo1", DefDef("", Nil, List(List(ValDef("a", TypeTree.Ident("Int"), None))), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(ValDef("a", TypeTree.Inferred(), None)))), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo1", DefDef("", Nil, List(List(ValDef("a", TypeTree.TypeIdent("Int"), None))), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(ValDef("a", TypeTree.Inferred(), None)))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo2", DefDef("", Nil, List(List(ValDef("b", TypeTree.Ident("Int"), None))), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(ValDef("b", TypeTree.Inferred(), None)))), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo2", DefDef("", Nil, List(List(ValDef("b", TypeTree.TypeIdent("Int"), None))), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(ValDef("b", TypeTree.Inferred(), None)))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo3", DefDef("", Nil, List(List(ValDef("a", TypeTree.Ident("Int"), None))), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(ValDef("a", TypeTree.Inferred(), None))), ValDef("Foo3", TypeTree.Ident("Foo3$"), Some(Term.Apply(Term.Select(Term.New(TypeTree.Ident("Foo3$")), ""), Nil))), ClassDef("Foo3$", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil), TypeTree.Select(Term.Select(Term.Ident("_root_"), "scala"), "Serializable")), Nil, Some(ValDef("_", TypeTree.Singleton(Term.Ident("Foo3")), None)), List(DefDef("$lessinit$greater$default$1", Nil, Nil, TypeTree.Inferred(), Some(Term.Literal(Constant.Int(5))))))), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo3", DefDef("", Nil, List(List(ValDef("a", TypeTree.TypeIdent("Int"), None))), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(ValDef("a", TypeTree.Inferred(), None))), ValDef("Foo3", TypeTree.TypeIdent("Foo3$"), Some(Term.Apply(Term.Select(Term.New(TypeTree.TypeIdent("Foo3$")), ""), Nil))), ClassDef("Foo3$", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil), TypeTree.TypeSelect(Term.Select(Term.Ident("_root_"), "scala"), "Serializable")), Nil, Some(ValDef("_", TypeTree.Singleton(Term.Ident("Foo3")), None)), List(DefDef("$lessinit$greater$default$1", Nil, Nil, TypeTree.Inferred(), Some(Term.Literal(Constant.Int(5))))))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo4", DefDef("", Nil, List(List(ValDef("a", TypeTree.Ident("Int"), None)), List(ValDef("b", TypeTree.Ident("Int"), None))), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(ValDef("a", TypeTree.Inferred(), None), ValDef("b", TypeTree.Inferred(), None)))), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo4", DefDef("", Nil, List(List(ValDef("a", TypeTree.TypeIdent("Int"), None)), List(ValDef("b", TypeTree.TypeIdent("Int"), None))), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(ValDef("a", TypeTree.Inferred(), None), ValDef("b", TypeTree.Inferred(), None)))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo5", DefDef("", Nil, List(List(ValDef("a", TypeTree.Ident("Int"), None)), List(ValDef("b", TypeTree.Ident("Int"), None))), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(ValDef("a", TypeTree.Inferred(), None), ValDef("b", TypeTree.Inferred(), None))), ValDef("Foo5", TypeTree.Ident("Foo5$"), Some(Term.Apply(Term.Select(Term.New(TypeTree.Ident("Foo5$")), ""), Nil))), ClassDef("Foo5$", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil), TypeTree.Select(Term.Select(Term.Ident("_root_"), "scala"), "Serializable")), Nil, Some(ValDef("_", TypeTree.Singleton(Term.Ident("Foo5")), None)), List(DefDef("$lessinit$greater$default$2", Nil, List(List(ValDef("a", TypeTree.Ident("Int"), None))), TypeTree.Inferred(), Some(Term.Ident("a")))))), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo5", DefDef("", Nil, List(List(ValDef("a", TypeTree.TypeIdent("Int"), None)), List(ValDef("b", TypeTree.TypeIdent("Int"), None))), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(ValDef("a", TypeTree.Inferred(), None), ValDef("b", TypeTree.Inferred(), None))), ValDef("Foo5", TypeTree.TypeIdent("Foo5$"), Some(Term.Apply(Term.Select(Term.New(TypeTree.TypeIdent("Foo5$")), ""), Nil))), ClassDef("Foo5$", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil), TypeTree.TypeSelect(Term.Select(Term.Ident("_root_"), "scala"), "Serializable")), Nil, Some(ValDef("_", TypeTree.Singleton(Term.Ident("Foo5")), None)), List(DefDef("$lessinit$greater$default$2", Nil, List(List(ValDef("a", TypeTree.TypeIdent("Int"), None))), TypeTree.Inferred(), Some(Term.Ident("a")))))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo6", DefDef("", Nil, List(List(ValDef("a", TypeTree.Ident("Int"), None)), List(ValDef("b", TypeTree.Singleton(Term.Ident("a")), None))), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(ValDef("a", TypeTree.Inferred(), None), ValDef("b", TypeTree.Inferred(), None)))), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo6", DefDef("", Nil, List(List(ValDef("a", TypeTree.TypeIdent("Int"), None)), List(ValDef("b", TypeTree.Singleton(Term.Ident("a")), None))), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(ValDef("a", TypeTree.Inferred(), None), ValDef("b", TypeTree.Inferred(), None)))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo7", DefDef("", Nil, List(List(ValDef("a", TypeTree.Ident("Int"), None))), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(ValDef("a", TypeTree.Inferred(), None), DefDef("", Nil, List(Nil), TypeTree.Inferred(), Some(Term.Block(List(Term.Apply(Term.Select(Term.This(Some(Id("Foo7"))), ""), List(Term.Literal(Constant.Int(6))))), Term.Literal(Constant.Unit()))))))), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo7", DefDef("", Nil, List(List(ValDef("a", TypeTree.TypeIdent("Int"), None))), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(ValDef("a", TypeTree.Inferred(), None), DefDef("", Nil, List(Nil), TypeTree.Inferred(), Some(Term.Block(List(Term.Apply(Term.Select(Term.This(Some(Id("Foo7"))), ""), List(Term.Literal(Constant.Int(6))))), Term.Literal(Constant.Unit()))))))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo8", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(Term.Apply(Term.Ident("println"), List(Term.Literal(Constant.Int(0))))))), Term.Literal(Constant.Unit()))) @@ -85,21 +85,21 @@ Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageD Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo12", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(ValDef("a", TypeTree.Inferred(), Some(Term.Literal(Constant.Int(11))))))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, Nil), ClassDef("Bar", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Ident("Foo")), ""), Nil)), Nil, None, Nil)), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, Nil), ClassDef("Bar", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.TypeIdent("Foo")), ""), Nil)), Nil, None, Nil)), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo2", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(TypeTree.Inferred()), Nil, None, Nil), ClassDef("Bar", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil), TypeTree.Ident("Foo2")), Nil, None, Nil)), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo2", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(TypeTree.Inferred()), Nil, None, Nil), ClassDef("Bar", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil), TypeTree.TypeIdent("Foo2")), Nil, None, Nil)), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo", DefDef("", Nil, List(List(ValDef("i", TypeTree.Ident("Int"), None))), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(ValDef("i", TypeTree.Inferred(), None))), ClassDef("Bar", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Ident("Foo")), ""), List(Term.Literal(Constant.Int(1))))), Nil, None, Nil)), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo", DefDef("", Nil, List(List(ValDef("i", TypeTree.TypeIdent("Int"), None))), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(ValDef("i", TypeTree.Inferred(), None))), ClassDef("Bar", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.TypeIdent("Foo")), ""), List(Term.Literal(Constant.Int(1))))), Nil, None, Nil)), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(TypeDef("X", TypeTree.Ident("Int")))), DefDef("f", Nil, List(List(ValDef("a", TypeTree.Ident("Foo"), None))), TypeTree.Select(Term.Ident("a"), "X"), Some(Term.Ident("???")))), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(TypeDef("X", TypeTree.TypeIdent("Int")))), DefDef("f", Nil, List(List(ValDef("a", TypeTree.TypeIdent("Foo"), None))), TypeTree.TypeSelect(Term.Ident("a"), "X"), Some(Term.Ident("???")))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(TypeDef("X", TypeBoundsTree(TypeTree.Inferred(), TypeTree.Inferred())))), DefDef("f", Nil, List(List(ValDef("a", TypeTree.Refined(TypeTree.Ident("Foo"), List(TypeDef("X", TypeTree.Ident("Int")))), None))), TypeTree.Select(Term.Ident("a"), "X"), Some(Term.Ident("???")))), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), TypeTree.Inferred(), None), List(Term.Apply(Term.Select(Term.New(TypeTree.Inferred()), ""), Nil)), Nil, None, List(TypeDef("X", TypeBoundsTree(TypeTree.Inferred(), TypeTree.Inferred())))), DefDef("f", Nil, List(List(ValDef("a", TypeTree.Refined(TypeTree.TypeIdent("Foo"), List(TypeDef("X", TypeTree.TypeIdent("Int")))), None))), TypeTree.TypeSelect(Term.Ident("a"), "X"), Some(Term.Ident("???")))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Term.Inlined(None, Nil, Term.Block(List(ValDef("lambda", TypeTree.Applied(TypeTree.Inferred(), List(TypeTree.Ident("Int"), TypeTree.Ident("Int"))), Some(Term.Block(List(DefDef("$anonfun", Nil, List(List(ValDef("x", TypeTree.Inferred(), None))), TypeTree.Inferred(), Some(Term.Ident("x")))), Term.Lambda(Term.Ident("$anonfun"), None))))), Term.Literal(Constant.Unit()))) +Term.Inlined(None, Nil, Term.Block(List(ValDef("lambda", TypeTree.Applied(TypeTree.Inferred(), List(TypeTree.TypeIdent("Int"), TypeTree.TypeIdent("Int"))), Some(Term.Block(List(DefDef("$anonfun", Nil, List(List(ValDef("x", TypeTree.Inferred(), None))), TypeTree.Inferred(), Some(Term.Ident("x")))), Term.Lambda(Term.Ident("$anonfun"), None))))), Term.Literal(Constant.Unit()))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) From 772e3a494de83e092a4b49b326bbad6f8405bb7e Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Fri, 29 Mar 2019 10:45:41 +0100 Subject: [PATCH 2/3] Rename TypeTree.MatchType to TypeTree.MatchTypeTree --- .../tools/dotc/tastyreflect/KernelImpl.scala | 14 +++++----- .../other-new-features/tasty-reflect.md | 4 +-- library/src/scala/tasty/reflect/Core.scala | 4 +-- library/src/scala/tasty/reflect/Kernel.scala | 16 +++++------ .../src/scala/tasty/reflect/Printers.scala | 8 +++--- library/src/scala/tasty/reflect/TreeOps.scala | 28 +++++++++---------- .../src/scala/tasty/reflect/TreeUtils.scala | 6 ++-- 7 files changed, 40 insertions(+), 40 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/tastyreflect/KernelImpl.scala b/compiler/src/dotty/tools/dotc/tastyreflect/KernelImpl.scala index 792f61b4a3d4..c723554d4ad3 100644 --- a/compiler/src/dotty/tools/dotc/tastyreflect/KernelImpl.scala +++ b/compiler/src/dotty/tools/dotc/tastyreflect/KernelImpl.scala @@ -760,21 +760,21 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util. def TypeTree_Annotated_copy(original: TypeTree_Annotated)(arg: TypeTree, annotation: Term)(implicit ctx: Context): TypeTree_Annotated = tpd.cpy.Annotated(original)(arg, annotation) - type TypeTree_MatchType = tpd.MatchTypeTree + type TypeTree_MatchTypeTree = tpd.MatchTypeTree - def matchTypeTree_MatchType(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[TypeTree_MatchType] = tpt match { + def matchTypeTree_MatchTypeTree(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[TypeTree_MatchTypeTree] = tpt match { case tpt: tpd.MatchTypeTree => Some(tpt) case _ => None } - def TypeTree_MatchType_bound(self: TypeTree_MatchType)(implicit ctx: Context): Option[TypeTree] = if (self.bound == tpd.EmptyTree) None else Some(self.bound) - def TypeTree_MatchType_selector(self: TypeTree_MatchType)(implicit ctx: Context): TypeTree = self.selector - def TypeTree_MatchType_cases(self: TypeTree_MatchType)(implicit ctx: Context): List[CaseDef] = self.cases + def TypeTree_MatchTypeTree_bound(self: TypeTree_MatchTypeTree)(implicit ctx: Context): Option[TypeTree] = if (self.bound == tpd.EmptyTree) None else Some(self.bound) + def TypeTree_MatchTypeTree_selector(self: TypeTree_MatchTypeTree)(implicit ctx: Context): TypeTree = self.selector + def TypeTree_MatchTypeTree_cases(self: TypeTree_MatchTypeTree)(implicit ctx: Context): List[CaseDef] = self.cases - def TypeTree_MatchType_apply(bound: Option[TypeTree], selector: TypeTree, cases: List[TypeCaseDef])(implicit ctx: Context): TypeTree_MatchType = + def TypeTree_MatchTypeTree_apply(bound: Option[TypeTree], selector: TypeTree, cases: List[TypeCaseDef])(implicit ctx: Context): TypeTree_MatchTypeTree = withDefaultPos(ctx => tpd.MatchTypeTree(bound.getOrElse(tpd.EmptyTree), selector, cases)(ctx)) - def TypeTree_MatchType_copy(original: TypeTree_MatchType)(bound: Option[TypeTree], selector: TypeTree, cases: List[TypeCaseDef])(implicit ctx: Context): TypeTree_MatchType = + def TypeTree_MatchTypeTree_copy(original: TypeTree_MatchTypeTree)(bound: Option[TypeTree], selector: TypeTree, cases: List[TypeCaseDef])(implicit ctx: Context): TypeTree_MatchTypeTree = tpd.cpy.MatchTypeTree(original)(bound.getOrElse(tpd.EmptyTree), selector, cases) type TypeTree_ByName = tpd.ByNameTypeTree diff --git a/docs/docs/reference/other-new-features/tasty-reflect.md b/docs/docs/reference/other-new-features/tasty-reflect.md index a1795599c587..a0f7603f224e 100644 --- a/docs/docs/reference/other-new-features/tasty-reflect.md +++ b/docs/docs/reference/other-new-features/tasty-reflect.md @@ -116,7 +116,7 @@ TASTy Reflect provides the following types: | +- SelectOuter | +- While | - +- TypeTree ----+- Synthetic + +- TypeTree ----+- Inferred | +- TypeIdent | +- TypeSelect | +- Project @@ -124,7 +124,7 @@ TASTy Reflect provides the following types: | +- Refined | +- Applied | +- Annotated - | +- MatchType + | +- MatchTypeTree | +- ByName | +- LambdaTypeTree | +- Bind diff --git a/library/src/scala/tasty/reflect/Core.scala b/library/src/scala/tasty/reflect/Core.scala index 0e6d458f9bbe..87fcfb510899 100644 --- a/library/src/scala/tasty/reflect/Core.scala +++ b/library/src/scala/tasty/reflect/Core.scala @@ -46,7 +46,7 @@ package scala.tasty.reflect * | +- Refined * | +- Applied * | +- Annotated - * | +- MatchType + * | +- MatchTypeTree * | +- ByName * | +- LambdaTypeTree * | +- TypeBind @@ -271,7 +271,7 @@ trait Core { type Annotated = kernel.TypeTree_Annotated /** Type tree representing a type match */ - type MatchType = kernel.TypeTree_MatchType + type MatchTypeTree = kernel.TypeTree_MatchTypeTree /** Type tree representing a by name parameter */ type ByName = kernel.TypeTree_ByName diff --git a/library/src/scala/tasty/reflect/Kernel.scala b/library/src/scala/tasty/reflect/Kernel.scala index 98db6d2035d5..39e1aadf5ddb 100644 --- a/library/src/scala/tasty/reflect/Kernel.scala +++ b/library/src/scala/tasty/reflect/Kernel.scala @@ -45,7 +45,7 @@ package scala.tasty.reflect * | +- TypeTree_Refined * | +- TypeTree_Applied * | +- TypeTree_Annotated - * | +- TypeTree_MatchType + * | +- TypeTree_MatchTypeTreeTree * | +- TypeTree_ByName * | +- TypeTree_LambdaTypeTree * | +- TypeTree_TypeBind @@ -629,16 +629,16 @@ trait Kernel { def TypeTree_Annotated_copy(original: TypeTree_Annotated)(arg: TypeTree, annotation: Term)(implicit ctx: Context): TypeTree_Annotated /** Type tree representing a type match */ - type TypeTree_MatchType <: TypeTree + type TypeTree_MatchTypeTree <: TypeTree - def matchTypeTree_MatchType(tree: Tree)(implicit ctx: Context): Option[TypeTree_MatchType] + def matchTypeTree_MatchTypeTree(tree: Tree)(implicit ctx: Context): Option[TypeTree_MatchTypeTree] - def TypeTree_MatchType_bound(self: TypeTree_MatchType)(implicit ctx: Context): Option[TypeTree] - def TypeTree_MatchType_selector(self: TypeTree_MatchType)(implicit ctx: Context): TypeTree - def TypeTree_MatchType_cases(self: TypeTree_MatchType)(implicit ctx: Context): List[TypeCaseDef] + def TypeTree_MatchTypeTree_bound(self: TypeTree_MatchTypeTree)(implicit ctx: Context): Option[TypeTree] + def TypeTree_MatchTypeTree_selector(self: TypeTree_MatchTypeTree)(implicit ctx: Context): TypeTree + def TypeTree_MatchTypeTree_cases(self: TypeTree_MatchTypeTree)(implicit ctx: Context): List[TypeCaseDef] - def TypeTree_MatchType_apply(bound: Option[TypeTree], selector: TypeTree, cases: List[TypeCaseDef])(implicit ctx: Context): TypeTree_MatchType - def TypeTree_MatchType_copy(original: TypeTree_MatchType)(bound: Option[TypeTree], selector: TypeTree, cases: List[TypeCaseDef])(implicit ctx: Context): TypeTree_MatchType + def TypeTree_MatchTypeTree_apply(bound: Option[TypeTree], selector: TypeTree, cases: List[TypeCaseDef])(implicit ctx: Context): TypeTree_MatchTypeTree + def TypeTree_MatchTypeTree_copy(original: TypeTree_MatchTypeTree)(bound: Option[TypeTree], selector: TypeTree, cases: List[TypeCaseDef])(implicit ctx: Context): TypeTree_MatchTypeTree /** Type tree representing a by name parameter */ type TypeTree_ByName <: TypeTree diff --git a/library/src/scala/tasty/reflect/Printers.scala b/library/src/scala/tasty/reflect/Printers.scala index 05ead29502cd..2f3ee70a5b00 100644 --- a/library/src/scala/tasty/reflect/Printers.scala +++ b/library/src/scala/tasty/reflect/Printers.scala @@ -237,8 +237,8 @@ trait Printers this += "TypeBoundsTree(" += lo += ", " += hi += ")" case WildcardTypeTree() => this += s"WildcardTypeTree()" - case TypeTree.MatchType(bound, selector, cases) => - this += "TypeTree.MatchType(" += bound += ", " += selector += ", " ++= cases += ")" + case TypeTree.MatchTypeTree(bound, selector, cases) => + this += "TypeTree.MatchTypeTree(" += bound += ", " += selector += ", " ++= cases += ")" case CaseDef(pat, guard, body) => this += "CaseDef(" += pat += ", " += guard += ", " += body += ")" case TypeCaseDef(pat, body) => @@ -1188,7 +1188,7 @@ trait Printers inSquare(printSeparated(tparams)) if (isMember) { body match { - case TypeTree.MatchType(Some(bound), _, _) => + case TypeTree.MatchTypeTree(Some(bound), _, _) => this += " <: " printTypeTree(bound) case _ => @@ -1426,7 +1426,7 @@ trait Printers printAnnotation(annot) } - case TypeTree.MatchType(bound, selector, cases) => + case TypeTree.MatchTypeTree(bound, selector, cases) => printTypeTree(selector) this += highlightKeyword(" match ", color) inBlock(printTypeCases(cases, lineBreak())) diff --git a/library/src/scala/tasty/reflect/TreeOps.scala b/library/src/scala/tasty/reflect/TreeOps.scala index 3b3ea80b1d63..134d8a6cec15 100644 --- a/library/src/scala/tasty/reflect/TreeOps.scala +++ b/library/src/scala/tasty/reflect/TreeOps.scala @@ -895,19 +895,19 @@ trait TreeOps extends Core { kernel.matchTypeTree_Annotated(tree).map(x => (x.arg, x.annotation)) } - object IsMatchType { - /** Matches any MatchType and returns it */ - def unapply(tree: Tree)(implicit ctx: Context): Option[MatchType] = - kernel.matchTypeTree_MatchType(tree) + object IsMatchTypeTree { + /** Matches any MatchTypeTree and returns it */ + def unapply(tree: Tree)(implicit ctx: Context): Option[MatchTypeTree] = + kernel.matchTypeTree_MatchTypeTree(tree) } - object MatchType { - def apply(bound: Option[TypeTree], selector: TypeTree, cases: List[TypeCaseDef])(implicit ctx: Context): MatchType = - kernel.TypeTree_MatchType_apply(bound, selector, cases) - def copy(original: MatchType)(bound: Option[TypeTree], selector: TypeTree, cases: List[TypeCaseDef])(implicit ctx: Context): MatchType = - kernel.TypeTree_MatchType_copy(original)(bound, selector, cases) + object MatchTypeTree { + def apply(bound: Option[TypeTree], selector: TypeTree, cases: List[TypeCaseDef])(implicit ctx: Context): MatchTypeTree = + kernel.TypeTree_MatchTypeTree_apply(bound, selector, cases) + def copy(original: MatchTypeTree)(bound: Option[TypeTree], selector: TypeTree, cases: List[TypeCaseDef])(implicit ctx: Context): MatchTypeTree = + kernel.TypeTree_MatchTypeTree_copy(original)(bound, selector, cases) def unapply(tree: Tree)(implicit ctx: Context): Option[(Option[TypeTree], TypeTree, List[TypeCaseDef])] = - kernel.matchTypeTree_MatchType(tree).map(x => (x.bound, x.selector, x.cases)) + kernel.matchTypeTree_MatchTypeTree(tree).map(x => (x.bound, x.selector, x.cases)) } object IsByName { @@ -1003,10 +1003,10 @@ trait TreeOps extends Core { def annotation(implicit ctx: Context): Term = kernel.TypeTree_Annotated_annotation(self) } - implicit class TypeTree_MatchTypeAPI(self: TypeTree.MatchType) { - def bound(implicit ctx: Context): Option[TypeTree] = kernel.TypeTree_MatchType_bound(self) - def selector(implicit ctx: Context): TypeTree = kernel.TypeTree_MatchType_selector(self) - def cases(implicit ctx: Context): List[TypeCaseDef] = kernel.TypeTree_MatchType_cases(self) + implicit class TypeTree_MatchTypeTreeAPI(self: TypeTree.MatchTypeTree) { + def bound(implicit ctx: Context): Option[TypeTree] = kernel.TypeTree_MatchTypeTree_bound(self) + def selector(implicit ctx: Context): TypeTree = kernel.TypeTree_MatchTypeTree_selector(self) + def cases(implicit ctx: Context): List[TypeCaseDef] = kernel.TypeTree_MatchTypeTree_cases(self) } implicit class TypeTree_ByNameAPI(self: TypeTree.ByName) { diff --git a/library/src/scala/tasty/reflect/TreeUtils.scala b/library/src/scala/tasty/reflect/TreeUtils.scala index 865c0850910f..50de53632cad 100644 --- a/library/src/scala/tasty/reflect/TreeUtils.scala +++ b/library/src/scala/tasty/reflect/TreeUtils.scala @@ -87,7 +87,7 @@ trait TreeUtils case TypeTree.LambdaTypeTree(typedefs, arg) => foldTree(foldTrees(x, typedefs), arg) case TypeTree.TypeBind(_, tbt) => foldTree(x, tbt) case TypeTree.TypeBlock(typedefs, tpt) => foldTree(foldTrees(x, typedefs), tpt) - case TypeTree.MatchType(boundopt, selector, cases) => + case TypeTree.MatchTypeTree(boundopt, selector, cases) => foldTrees(foldTree(boundopt.fold(x)(foldTree(x, _)), selector), cases) case WildcardTypeTree() => x case TypeBoundsTree(lo, hi) => foldTree(foldTree(x, lo), hi) @@ -222,8 +222,8 @@ trait TreeUtils TypeTree.Refined.copy(tree)(transformTypeTree(tree.tpt), transformTrees(tree.refinements).asInstanceOf[List[Definition]]) case TypeTree.IsApplied(tree) => TypeTree.Applied.copy(tree)(transformTypeTree(tree.tpt), transformTrees(tree.args)) - case TypeTree.IsMatchType(tree) => - TypeTree.MatchType.copy(tree)(tree.bound.map(b => transformTypeTree(b)), transformTypeTree(tree.selector), transformTypeCaseDefs(tree.cases)) + case TypeTree.IsMatchTypeTree(tree) => + TypeTree.MatchTypeTree.copy(tree)(tree.bound.map(b => transformTypeTree(b)), transformTypeTree(tree.selector), transformTypeCaseDefs(tree.cases)) case TypeTree.IsByName(tree) => TypeTree.ByName.copy(tree)(transformTypeTree(tree.result)) case TypeTree.IsLambdaTypeTree(tree) => From dc7c97f756dd37c1a718c1897384e42a4161dbbb Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Fri, 29 Mar 2019 10:52:32 +0100 Subject: [PATCH 3/3] Remove TypeTree_ prefix from the Kernel --- .../tools/dotc/tastyreflect/KernelImpl.scala | 140 +++++++-------- library/src/scala/tasty/reflect/Core.scala | 26 +-- library/src/scala/tasty/reflect/Kernel.scala | 166 +++++++++--------- library/src/scala/tasty/reflect/TreeOps.scala | 162 ++++++++--------- 4 files changed, 247 insertions(+), 247 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/tastyreflect/KernelImpl.scala b/compiler/src/dotty/tools/dotc/tastyreflect/KernelImpl.scala index c723554d4ad3..14e7e2b2315d 100644 --- a/compiler/src/dotty/tools/dotc/tastyreflect/KernelImpl.scala +++ b/compiler/src/dotty/tools/dotc/tastyreflect/KernelImpl.scala @@ -649,192 +649,192 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util. def TypeTree_symbol(self: TypeTree)(implicit ctx: Context): Symbol = self.symbol def TypeTree_tpe(self: TypeTree)(implicit ctx: Context): Type = self.tpe.stripTypeVar - type TypeTree_Inferred = tpd.TypeTree + type Inferred = tpd.TypeTree - def matchTypeTree_Inferred(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[TypeTree_Inferred] = tpt match { + def matchInferred(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[Inferred] = tpt match { case tpt: tpd.TypeTree if !tpt.tpe.isInstanceOf[Types.TypeBounds] => Some(tpt) case _ => None } - def TypeTree_Inferred_apply(tpe: Type)(implicit ctx: Context): TypeTree_Inferred = withDefaultPos(ctx => tpd.TypeTree(tpe)(ctx)) + def Inferred_apply(tpe: Type)(implicit ctx: Context): Inferred = withDefaultPos(ctx => tpd.TypeTree(tpe)(ctx)) - type TypeTree_TypeIdent = tpd.Ident + type TypeIdent = tpd.Ident - def matchTypeTree_TypeIdent(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[TypeTree_TypeIdent] = tpt match { + def matchTypeIdent(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[TypeIdent] = tpt match { case tpt: tpd.Ident if tpt.isType => Some(tpt) case _ => None } - def TypeTree_TypeIdent_name(self: TypeTree_TypeIdent)(implicit ctx: Context): String = self.name.toString + def TypeIdent_name(self: TypeIdent)(implicit ctx: Context): String = self.name.toString - def TypeTree_TypeIdent_copy(original: TypeTree_TypeIdent)(name: String)(implicit ctx: Context): TypeTree_TypeIdent = + def TypeIdent_copy(original: TypeIdent)(name: String)(implicit ctx: Context): TypeIdent = tpd.cpy.Ident(original)(name.toTypeName) - type TypeTree_TypeSelect = tpd.Select + type TypeSelect = tpd.Select - def matchTypeTree_TypeSelect(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[TypeTree_TypeSelect] = tpt match { + def matchTypeSelect(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[TypeSelect] = tpt match { case tpt: tpd.Select if tpt.isType && tpt.qualifier.isTerm => Some(tpt) case _ => None } - def TypeTree_TypeSelect_qualifier(self: TypeTree_TypeSelect)(implicit ctx: Context): Term = self.qualifier - def TypeTree_TypeSelect_name(self: TypeTree_TypeSelect)(implicit ctx: Context): String = self.name.toString + def TypeSelect_qualifier(self: TypeSelect)(implicit ctx: Context): Term = self.qualifier + def TypeSelect_name(self: TypeSelect)(implicit ctx: Context): String = self.name.toString - def TypeTree_TypeSelect_apply(qualifier: Term, name: String)(implicit ctx: Context): TypeTree_TypeSelect = + def TypeSelect_apply(qualifier: Term, name: String)(implicit ctx: Context): TypeSelect = withDefaultPos(ctx => tpd.Select(qualifier, name.toTypeName)(ctx)) - def TypeTree_TypeSelect_copy(original: TypeTree_TypeSelect)(qualifier: Term, name: String)(implicit ctx: Context): TypeTree_TypeSelect = + def TypeSelect_copy(original: TypeSelect)(qualifier: Term, name: String)(implicit ctx: Context): TypeSelect = tpd.cpy.Select(original)(qualifier, name.toTypeName) - type TypeTree_Projection = tpd.Select + type Projection = tpd.Select - def matchTypeTree_Projection(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[TypeTree_Projection] = tpt match { + def matchProjection(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[Projection] = tpt match { case tpt: tpd.Select if tpt.isType && tpt.qualifier.isType => Some(tpt) case _ => None } - def TypeTree_Projection_qualifier(self: TypeTree_Projection)(implicit ctx: Context): TypeTree = self.qualifier - def TypeTree_Projection_name(self: TypeTree_Projection)(implicit ctx: Context): String = self.name.toString + def Projection_qualifier(self: Projection)(implicit ctx: Context): TypeTree = self.qualifier + def Projection_name(self: Projection)(implicit ctx: Context): String = self.name.toString - def TypeTree_Projection_copy(original: TypeTree_Projection)(qualifier: TypeTree, name: String)(implicit ctx: Context): TypeTree_Projection = + def Projection_copy(original: Projection)(qualifier: TypeTree, name: String)(implicit ctx: Context): Projection = tpd.cpy.Select(original)(qualifier, name.toTypeName) - type TypeTree_Singleton = tpd.SingletonTypeTree + type Singleton = tpd.SingletonTypeTree - def matchTypeTree_Singleton(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[TypeTree_Singleton] = tpt match { + def matchSingleton(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[Singleton] = tpt match { case tpt: tpd.SingletonTypeTree => Some(tpt) case _ => None } - def TypeTree_Singleton_ref(self: TypeTree_Singleton)(implicit ctx: Context): Term = self.ref + def Singleton_ref(self: Singleton)(implicit ctx: Context): Term = self.ref - def TypeTree_Singleton_apply(ref: Term)(implicit ctx: Context): TypeTree_Singleton = + def Singleton_apply(ref: Term)(implicit ctx: Context): Singleton = withDefaultPos(ctx => tpd.SingletonTypeTree(ref)(ctx)) - def TypeTree_Singleton_copy(original: TypeTree_Singleton)(ref: Term)(implicit ctx: Context): TypeTree_Singleton = + def Singleton_copy(original: Singleton)(ref: Term)(implicit ctx: Context): Singleton = tpd.cpy.SingletonTypeTree(original)(ref) - type TypeTree_Refined = tpd.RefinedTypeTree + type Refined = tpd.RefinedTypeTree - def matchTypeTree_Refined(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[TypeTree_Refined] = tpt match { + def matchRefined(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[Refined] = tpt match { case tpt: tpd.RefinedTypeTree => Some(tpt) case _ => None } - def TypeTree_Refined_tpt(self: TypeTree_Refined)(implicit ctx: Context): TypeTree = self.tpt - def TypeTree_Refined_refinements(self: TypeTree_Refined)(implicit ctx: Context): List[Definition] = self.refinements + def Refined_tpt(self: Refined)(implicit ctx: Context): TypeTree = self.tpt + def Refined_refinements(self: Refined)(implicit ctx: Context): List[Definition] = self.refinements - def TypeTree_Refined_copy(original: TypeTree_Refined)(tpt: TypeTree, refinements: List[Definition])(implicit ctx: Context): TypeTree_Refined = + def Refined_copy(original: Refined)(tpt: TypeTree, refinements: List[Definition])(implicit ctx: Context): Refined = tpd.cpy.RefinedTypeTree(original)(tpt, refinements) - type TypeTree_Applied = tpd.AppliedTypeTree + type Applied = tpd.AppliedTypeTree - def matchTypeTree_Applied(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[TypeTree_Applied] = tpt match { + def matchApplied(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[Applied] = tpt match { case tpt: tpd.AppliedTypeTree => Some(tpt) case _ => None } - def TypeTree_Applied_tpt(self: TypeTree_Applied)(implicit ctx: Context): TypeTree = self.tpt - def TypeTree_Applied_args(self: TypeTree_Applied)(implicit ctx: Context): List[Tree /*TypeTree | TypeBoundsTree*/] = self.args + def Applied_tpt(self: Applied)(implicit ctx: Context): TypeTree = self.tpt + def Applied_args(self: Applied)(implicit ctx: Context): List[Tree /*TypeTree | TypeBoundsTree*/] = self.args - def TypeTree_Applied_apply(tpt: TypeTree, args: List[Tree /*TypeTree | TypeBoundsTree*/])(implicit ctx: Context): TypeTree_Applied = + def Applied_apply(tpt: TypeTree, args: List[Tree /*TypeTree | TypeBoundsTree*/])(implicit ctx: Context): Applied = withDefaultPos(ctx => tpd.AppliedTypeTree(tpt, args)(ctx)) - def TypeTree_Applied_copy(original: TypeTree_Applied)(tpt: TypeTree, args: List[Tree /*TypeTree | TypeBoundsTree*/])(implicit ctx: Context): TypeTree_Applied = + def Applied_copy(original: Applied)(tpt: TypeTree, args: List[Tree /*TypeTree | TypeBoundsTree*/])(implicit ctx: Context): Applied = tpd.cpy.AppliedTypeTree(original)(tpt, args) - type TypeTree_Annotated = tpd.Annotated + type Annotated = tpd.Annotated - def matchTypeTree_Annotated(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[TypeTree_Annotated] = tpt match { + def matchAnnotated(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[Annotated] = tpt match { case tpt: tpd.Annotated => Some(tpt) case _ => None } - def TypeTree_Annotated_arg(self: TypeTree_Annotated)(implicit ctx: Context): TypeTree = self.arg - def TypeTree_Annotated_annotation(self: TypeTree_Annotated)(implicit ctx: Context): Term = self.annot + def Annotated_arg(self: Annotated)(implicit ctx: Context): TypeTree = self.arg + def Annotated_annotation(self: Annotated)(implicit ctx: Context): Term = self.annot - def TypeTree_Annotated_apply(arg: TypeTree, annotation: Term)(implicit ctx: Context): TypeTree_Annotated = + def Annotated_apply(arg: TypeTree, annotation: Term)(implicit ctx: Context): Annotated = withDefaultPos(ctx => tpd.Annotated(arg, annotation)(ctx)) - def TypeTree_Annotated_copy(original: TypeTree_Annotated)(arg: TypeTree, annotation: Term)(implicit ctx: Context): TypeTree_Annotated = + def Annotated_copy(original: Annotated)(arg: TypeTree, annotation: Term)(implicit ctx: Context): Annotated = tpd.cpy.Annotated(original)(arg, annotation) - type TypeTree_MatchTypeTree = tpd.MatchTypeTree + type MatchTypeTree = tpd.MatchTypeTree - def matchTypeTree_MatchTypeTree(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[TypeTree_MatchTypeTree] = tpt match { + def matchMatchTypeTree(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[MatchTypeTree] = tpt match { case tpt: tpd.MatchTypeTree => Some(tpt) case _ => None } - def TypeTree_MatchTypeTree_bound(self: TypeTree_MatchTypeTree)(implicit ctx: Context): Option[TypeTree] = if (self.bound == tpd.EmptyTree) None else Some(self.bound) - def TypeTree_MatchTypeTree_selector(self: TypeTree_MatchTypeTree)(implicit ctx: Context): TypeTree = self.selector - def TypeTree_MatchTypeTree_cases(self: TypeTree_MatchTypeTree)(implicit ctx: Context): List[CaseDef] = self.cases + def MatchTypeTree_bound(self: MatchTypeTree)(implicit ctx: Context): Option[TypeTree] = if (self.bound == tpd.EmptyTree) None else Some(self.bound) + def MatchTypeTree_selector(self: MatchTypeTree)(implicit ctx: Context): TypeTree = self.selector + def MatchTypeTree_cases(self: MatchTypeTree)(implicit ctx: Context): List[CaseDef] = self.cases - def TypeTree_MatchTypeTree_apply(bound: Option[TypeTree], selector: TypeTree, cases: List[TypeCaseDef])(implicit ctx: Context): TypeTree_MatchTypeTree = + def MatchTypeTree_apply(bound: Option[TypeTree], selector: TypeTree, cases: List[TypeCaseDef])(implicit ctx: Context): MatchTypeTree = withDefaultPos(ctx => tpd.MatchTypeTree(bound.getOrElse(tpd.EmptyTree), selector, cases)(ctx)) - def TypeTree_MatchTypeTree_copy(original: TypeTree_MatchTypeTree)(bound: Option[TypeTree], selector: TypeTree, cases: List[TypeCaseDef])(implicit ctx: Context): TypeTree_MatchTypeTree = + def MatchTypeTree_copy(original: MatchTypeTree)(bound: Option[TypeTree], selector: TypeTree, cases: List[TypeCaseDef])(implicit ctx: Context): MatchTypeTree = tpd.cpy.MatchTypeTree(original)(bound.getOrElse(tpd.EmptyTree), selector, cases) - type TypeTree_ByName = tpd.ByNameTypeTree + type ByName = tpd.ByNameTypeTree - def matchTypeTree_ByName(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[TypeTree_ByName] = tpt match { + def matchByName(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[ByName] = tpt match { case tpt: tpd.ByNameTypeTree => Some(tpt) case _ => None } - def TypeTree_ByName_result(self: TypeTree_ByName)(implicit ctx: Context): TypeTree = self.result + def ByName_result(self: ByName)(implicit ctx: Context): TypeTree = self.result - def TypeTree_ByName_apply(result: TypeTree)(implicit ctx: Context): TypeTree_ByName = + def ByName_apply(result: TypeTree)(implicit ctx: Context): ByName = withDefaultPos(ctx => tpd.ByNameTypeTree(result)(ctx)) - def TypeTree_ByName_copy(original: TypeTree_ByName)(result: TypeTree)(implicit ctx: Context): TypeTree_ByName = + def ByName_copy(original: ByName)(result: TypeTree)(implicit ctx: Context): ByName = tpd.cpy.ByNameTypeTree(original)(result) - type TypeTree_LambdaTypeTree = tpd.LambdaTypeTree + type LambdaTypeTree = tpd.LambdaTypeTree - def matchTypeTree_LambdaTypeTree(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[TypeTree_LambdaTypeTree] = tpt match { + def matchLambdaTypeTree(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[LambdaTypeTree] = tpt match { case tpt: tpd.LambdaTypeTree => Some(tpt) case _ => None } - def TypeTree_LambdaTypeTree_tparams(self: TypeTree_LambdaTypeTree)(implicit ctx: Context): List[TypeDef] = self.tparams - def TypeTree_LambdaTypeTree_body(self: TypeTree_LambdaTypeTree)(implicit ctx: Context): Tree /*TypeTree | TypeBoundsTree*/ = self.body + def Lambdatparams(self: LambdaTypeTree)(implicit ctx: Context): List[TypeDef] = self.tparams + def Lambdabody(self: LambdaTypeTree)(implicit ctx: Context): Tree /*TypeTree | TypeBoundsTree*/ = self.body - def TypeTree_LambdaTypeTree_apply(tparams: List[TypeDef], body: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): TypeTree_LambdaTypeTree = + def Lambdaapply(tparams: List[TypeDef], body: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): LambdaTypeTree = withDefaultPos(ctx => tpd.LambdaTypeTree(tparams, body)(ctx)) - def TypeTree_LambdaTypeTree_copy(original: TypeTree_LambdaTypeTree)(tparams: List[TypeDef], body: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): TypeTree_LambdaTypeTree = + def Lambdacopy(original: LambdaTypeTree)(tparams: List[TypeDef], body: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): LambdaTypeTree = tpd.cpy.LambdaTypeTree(original)(tparams, body) - type TypeTree_TypeBind = tpd.Bind + type TypeBind = tpd.Bind - def matchTypeTree_TypeBind(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[TypeTree_TypeBind] = tpt match { + def matchTypeBind(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[TypeBind] = tpt match { case tpt: tpd.Bind if tpt.name.isTypeName => Some(tpt) case _ => None } - def TypeTree_TypeBind_name(self: TypeTree_TypeBind)(implicit ctx: Context): String = self.name.toString - def TypeTree_TypeBind_body(self: TypeTree_TypeBind)(implicit ctx: Context): Tree /*TypeTree | TypeBoundsTree*/ = self.body + def TypeBind_name(self: TypeBind)(implicit ctx: Context): String = self.name.toString + def TypeBind_body(self: TypeBind)(implicit ctx: Context): Tree /*TypeTree | TypeBoundsTree*/ = self.body - def TypeTree_TypeBind_copy(original: TypeTree_TypeBind)(name: String, tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): TypeTree_TypeBind = + def TypeBind_copy(original: TypeBind)(name: String, tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): TypeBind = tpd.cpy.Bind(original)(name.toTypeName, tpt) - type TypeTree_TypeBlock = tpd.Block + type TypeBlock = tpd.Block - def matchTypeTree_TypeBlock(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[TypeTree_TypeBlock] = tpt match { + def matchTypeBlock(tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): Option[TypeBlock] = tpt match { case tpt: tpd.Block => Some(tpt) case _ => None } - def TypeTree_TypeBlock_aliases(self: TypeTree_TypeBlock)(implicit ctx: Context): List[TypeDef] = self.stats.map { case alias: TypeDef => alias } - def TypeTree_TypeBlock_tpt(self: TypeTree_TypeBlock)(implicit ctx: Context): TypeTree = self.expr + def TypeBlock_aliases(self: TypeBlock)(implicit ctx: Context): List[TypeDef] = self.stats.map { case alias: TypeDef => alias } + def TypeBlock_tpt(self: TypeBlock)(implicit ctx: Context): TypeTree = self.expr - def TypeTree_TypeBlock_apply(aliases: List[TypeDef], tpt: TypeTree)(implicit ctx: Context): TypeTree_TypeBlock = + def TypeBlock_apply(aliases: List[TypeDef], tpt: TypeTree)(implicit ctx: Context): TypeBlock = withDefaultPos(ctx => tpd.Block(aliases, tpt)(ctx)) - def TypeTree_TypeBlock_copy(original: TypeTree_TypeBlock)(aliases: List[TypeDef], tpt: TypeTree)(implicit ctx: Context): TypeTree_TypeBlock = + def TypeBlock_copy(original: TypeBlock)(aliases: List[TypeDef], tpt: TypeTree)(implicit ctx: Context): TypeBlock = tpd.cpy.Block(original)(aliases, tpt) type TypeBoundsTree = tpd.TypeBoundsTree @@ -1578,7 +1578,7 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util. def matchTypeBindSymbol(symbol: Symbol)(implicit ctx: Context): Option[TypeBindSymbol] = if (symbol.isType && symbol.is(core.Flags.Case)) Some(symbol.asType) else None - def TypeBindSymbol_tree(self: TypeBindSymbol)(implicit ctx: Context): TypeTree_TypeBind = + def TypeBindSymbol_tree(self: TypeBindSymbol)(implicit ctx: Context): TypeBind = FromSymbol.typeBindFromSym(self) type TermSymbol = core.Symbols.TermSymbol diff --git a/library/src/scala/tasty/reflect/Core.scala b/library/src/scala/tasty/reflect/Core.scala index 87fcfb510899..c852e8a22ac5 100644 --- a/library/src/scala/tasty/reflect/Core.scala +++ b/library/src/scala/tasty/reflect/Core.scala @@ -247,43 +247,43 @@ trait Core { trait TypeTreeCoreModule { /** Type tree representing an inferred type */ - type Inferred = kernel.TypeTree_Inferred + type Inferred = kernel.Inferred /** Type tree representing a reference to definition with a given name */ - type TypeIdent = kernel.TypeTree_TypeIdent + type TypeIdent = kernel.TypeIdent /** Type tree representing a selection of definition with a given name on a given term prefix */ - type TypeSelect = kernel.TypeTree_TypeSelect + type TypeSelect = kernel.TypeSelect /** Type tree representing a selection of definition with a given name on a given type prefix */ - type Projection = kernel.TypeTree_Projection + type Projection = kernel.Projection /** Type tree representing a singleton type */ - type Singleton = kernel.TypeTree_Singleton + type Singleton = kernel.Singleton /** Type tree representing a type refinement */ - type Refined = kernel.TypeTree_Refined + type Refined = kernel.Refined /** Type tree representing a type application */ - type Applied = kernel.TypeTree_Applied + type Applied = kernel.Applied /** Type tree representing an annotated type */ - type Annotated = kernel.TypeTree_Annotated + type Annotated = kernel.Annotated /** Type tree representing a type match */ - type MatchTypeTree = kernel.TypeTree_MatchTypeTree + type MatchTypeTree = kernel.MatchTypeTree /** Type tree representing a by name parameter */ - type ByName = kernel.TypeTree_ByName + type ByName = kernel.ByName /** Type tree representing a lambda abstraction type */ - type LambdaTypeTree = kernel.TypeTree_LambdaTypeTree + type LambdaTypeTree = kernel.LambdaTypeTree /** Type tree representing a type binding */ - type TypeBind = kernel.TypeTree_TypeBind + type TypeBind = kernel.TypeBind /** Type tree within a block with aliases `{ type U1 = ... ; T[U1, U2] }` */ - type TypeBlock = kernel.TypeTree_TypeBlock + type TypeBlock = kernel.TypeBlock } diff --git a/library/src/scala/tasty/reflect/Kernel.scala b/library/src/scala/tasty/reflect/Kernel.scala index 39e1aadf5ddb..81a2a4bc7026 100644 --- a/library/src/scala/tasty/reflect/Kernel.scala +++ b/library/src/scala/tasty/reflect/Kernel.scala @@ -37,19 +37,19 @@ package scala.tasty.reflect * | +- While * | * | - * +- TypeTree ----+- TypeTree_Inferred - * | +- TypeTree_TypeIdent - * | +- TypeTree_TypeSelect - * | +- TypeTree_Project - * | +- TypeTree_Singleton - * | +- TypeTree_Refined - * | +- TypeTree_Applied - * | +- TypeTree_Annotated - * | +- TypeTree_MatchTypeTreeTree - * | +- TypeTree_ByName - * | +- TypeTree_LambdaTypeTree - * | +- TypeTree_TypeBind - * | +- TypeTree_TypeBlock + * +- TypeTree ----+- Inferred + * | +- TypeIdent + * | +- TypeSelect + * | +- Project + * | +- Singleton + * | +- Refined + * | +- Applied + * | +- Annotated + * | +- MatchTypeTree + * | +- ByName + * | +- LambdaTypeTree + * | +- TypeBind + * | +- TypeBlock * | * +- TypeBoundsTree * +- WildcardTypeTree @@ -550,137 +550,137 @@ trait Kernel { def TypeTree_tpe(self: TypeTree)(implicit ctx: Context): Type /** Type tree representing an inferred type */ - type TypeTree_Inferred <: TypeTree + type Inferred <: TypeTree - def matchTypeTree_Inferred(tree: Tree)(implicit ctx: Context): Option[TypeTree_Inferred] + def matchInferred(tree: Tree)(implicit ctx: Context): Option[Inferred] - def TypeTree_Inferred_apply(tpe: Type)(implicit ctx: Context): TypeTree_Inferred + def Inferred_apply(tpe: Type)(implicit ctx: Context): Inferred /** Type tree representing a reference to definition with a given name */ - type TypeTree_TypeIdent <: TypeTree + type TypeIdent <: TypeTree - def matchTypeTree_TypeIdent(tree: Tree)(implicit ctx: Context): Option[TypeTree_TypeIdent] + def matchTypeIdent(tree: Tree)(implicit ctx: Context): Option[TypeIdent] - def TypeTree_TypeIdent_name(self: TypeTree_TypeIdent)(implicit ctx: Context): String + def TypeIdent_name(self: TypeIdent)(implicit ctx: Context): String - def TypeTree_TypeIdent_copy(original: TypeTree_TypeIdent)(name: String)(implicit ctx: Context): TypeTree_TypeIdent + def TypeIdent_copy(original: TypeIdent)(name: String)(implicit ctx: Context): TypeIdent /** Type tree representing a selection of definition with a given name on a given term prefix */ - type TypeTree_TypeSelect <: TypeTree + type TypeSelect <: TypeTree - def matchTypeTree_TypeSelect(tree: Tree)(implicit ctx: Context): Option[TypeTree_TypeSelect] + def matchTypeSelect(tree: Tree)(implicit ctx: Context): Option[TypeSelect] - def TypeTree_TypeSelect_qualifier(self: TypeTree_TypeSelect)(implicit ctx: Context): Term - def TypeTree_TypeSelect_name(self: TypeTree_TypeSelect)(implicit ctx: Context): String + def TypeSelect_qualifier(self: TypeSelect)(implicit ctx: Context): Term + def TypeSelect_name(self: TypeSelect)(implicit ctx: Context): String - def TypeTree_TypeSelect_apply(qualifier: Term, name: String)(implicit ctx: Context): TypeTree_TypeSelect - def TypeTree_TypeSelect_copy(original: TypeTree_TypeSelect)(qualifier: Term, name: String)(implicit ctx: Context): TypeTree_TypeSelect + def TypeSelect_apply(qualifier: Term, name: String)(implicit ctx: Context): TypeSelect + def TypeSelect_copy(original: TypeSelect)(qualifier: Term, name: String)(implicit ctx: Context): TypeSelect /** Type tree representing a selection of definition with a given name on a given type prefix */ - type TypeTree_Projection <: TypeTree + type Projection <: TypeTree - def matchTypeTree_Projection(tree: Tree)(implicit ctx: Context): Option[TypeTree_Projection] + def matchProjection(tree: Tree)(implicit ctx: Context): Option[Projection] - def TypeTree_Projection_qualifier(self: TypeTree_Projection)(implicit ctx: Context): TypeTree - def TypeTree_Projection_name(self: TypeTree_Projection)(implicit ctx: Context): String + def Projection_qualifier(self: Projection)(implicit ctx: Context): TypeTree + def Projection_name(self: Projection)(implicit ctx: Context): String - def TypeTree_Projection_copy(original: TypeTree_Projection)(qualifier: TypeTree, name: String)(implicit ctx: Context): TypeTree_Projection + def Projection_copy(original: Projection)(qualifier: TypeTree, name: String)(implicit ctx: Context): Projection /** Type tree representing a singleton type */ - type TypeTree_Singleton <: TypeTree + type Singleton <: TypeTree - def matchTypeTree_Singleton(tree: Tree)(implicit ctx: Context): Option[TypeTree_Singleton] + def matchSingleton(tree: Tree)(implicit ctx: Context): Option[Singleton] - def TypeTree_Singleton_ref(self: TypeTree_Singleton)(implicit ctx: Context): Term + def Singleton_ref(self: Singleton)(implicit ctx: Context): Term - def TypeTree_Singleton_apply(ref: Term)(implicit ctx: Context): TypeTree_Singleton - def TypeTree_Singleton_copy(original: TypeTree_Singleton)(ref: Term)(implicit ctx: Context): TypeTree_Singleton + def Singleton_apply(ref: Term)(implicit ctx: Context): Singleton + def Singleton_copy(original: Singleton)(ref: Term)(implicit ctx: Context): Singleton /** Type tree representing a type refinement */ - type TypeTree_Refined <: TypeTree + type Refined <: TypeTree - def matchTypeTree_Refined(tree: Tree)(implicit ctx: Context): Option[TypeTree_Refined] + def matchRefined(tree: Tree)(implicit ctx: Context): Option[Refined] - def TypeTree_Refined_tpt(self: TypeTree_Refined)(implicit ctx: Context): TypeTree - def TypeTree_Refined_refinements(self: TypeTree_Refined)(implicit ctx: Context): List[Definition] + def Refined_tpt(self: Refined)(implicit ctx: Context): TypeTree + def Refined_refinements(self: Refined)(implicit ctx: Context): List[Definition] - def TypeTree_Refined_copy(original: TypeTree_Refined)(tpt: TypeTree, refinements: List[Definition])(implicit ctx: Context): TypeTree_Refined + def Refined_copy(original: Refined)(tpt: TypeTree, refinements: List[Definition])(implicit ctx: Context): Refined /** Type tree representing a type application */ - type TypeTree_Applied <: TypeTree + type Applied <: TypeTree - def matchTypeTree_Applied(tree: Tree)(implicit ctx: Context): Option[TypeTree_Applied] + def matchApplied(tree: Tree)(implicit ctx: Context): Option[Applied] - def TypeTree_Applied_tpt(self: TypeTree_Applied)(implicit ctx: Context): TypeTree - def TypeTree_Applied_args(self: TypeTree_Applied)(implicit ctx: Context): List[Tree /*TypeTree | TypeBoundsTree*/] + def Applied_tpt(self: Applied)(implicit ctx: Context): TypeTree + def Applied_args(self: Applied)(implicit ctx: Context): List[Tree /*TypeTree | TypeBoundsTree*/] - def TypeTree_Applied_apply(tpt: TypeTree, args: List[Tree /*TypeTree | TypeBoundsTree*/])(implicit ctx: Context): TypeTree_Applied - def TypeTree_Applied_copy(original: TypeTree_Applied)(tpt: TypeTree, args: List[Tree /*TypeTree | TypeBoundsTree*/])(implicit ctx: Context): TypeTree_Applied + def Applied_apply(tpt: TypeTree, args: List[Tree /*TypeTree | TypeBoundsTree*/])(implicit ctx: Context): Applied + def Applied_copy(original: Applied)(tpt: TypeTree, args: List[Tree /*TypeTree | TypeBoundsTree*/])(implicit ctx: Context): Applied /** Type tree representing an annotated type */ - type TypeTree_Annotated <: TypeTree + type Annotated <: TypeTree - def matchTypeTree_Annotated(tree: Tree)(implicit ctx: Context): Option[TypeTree_Annotated] + def matchAnnotated(tree: Tree)(implicit ctx: Context): Option[Annotated] - def TypeTree_Annotated_arg(self: TypeTree_Annotated)(implicit ctx: Context): TypeTree - def TypeTree_Annotated_annotation(self: TypeTree_Annotated)(implicit ctx: Context): Term + def Annotated_arg(self: Annotated)(implicit ctx: Context): TypeTree + def Annotated_annotation(self: Annotated)(implicit ctx: Context): Term - def TypeTree_Annotated_apply(arg: TypeTree, annotation: Term)(implicit ctx: Context): TypeTree_Annotated - def TypeTree_Annotated_copy(original: TypeTree_Annotated)(arg: TypeTree, annotation: Term)(implicit ctx: Context): TypeTree_Annotated + def Annotated_apply(arg: TypeTree, annotation: Term)(implicit ctx: Context): Annotated + def Annotated_copy(original: Annotated)(arg: TypeTree, annotation: Term)(implicit ctx: Context): Annotated /** Type tree representing a type match */ - type TypeTree_MatchTypeTree <: TypeTree + type MatchTypeTree <: TypeTree - def matchTypeTree_MatchTypeTree(tree: Tree)(implicit ctx: Context): Option[TypeTree_MatchTypeTree] + def matchMatchTypeTree(tree: Tree)(implicit ctx: Context): Option[MatchTypeTree] - def TypeTree_MatchTypeTree_bound(self: TypeTree_MatchTypeTree)(implicit ctx: Context): Option[TypeTree] - def TypeTree_MatchTypeTree_selector(self: TypeTree_MatchTypeTree)(implicit ctx: Context): TypeTree - def TypeTree_MatchTypeTree_cases(self: TypeTree_MatchTypeTree)(implicit ctx: Context): List[TypeCaseDef] + def MatchTypeTree_bound(self: MatchTypeTree)(implicit ctx: Context): Option[TypeTree] + def MatchTypeTree_selector(self: MatchTypeTree)(implicit ctx: Context): TypeTree + def MatchTypeTree_cases(self: MatchTypeTree)(implicit ctx: Context): List[TypeCaseDef] - def TypeTree_MatchTypeTree_apply(bound: Option[TypeTree], selector: TypeTree, cases: List[TypeCaseDef])(implicit ctx: Context): TypeTree_MatchTypeTree - def TypeTree_MatchTypeTree_copy(original: TypeTree_MatchTypeTree)(bound: Option[TypeTree], selector: TypeTree, cases: List[TypeCaseDef])(implicit ctx: Context): TypeTree_MatchTypeTree + def MatchTypeTree_apply(bound: Option[TypeTree], selector: TypeTree, cases: List[TypeCaseDef])(implicit ctx: Context): MatchTypeTree + def MatchTypeTree_copy(original: MatchTypeTree)(bound: Option[TypeTree], selector: TypeTree, cases: List[TypeCaseDef])(implicit ctx: Context): MatchTypeTree /** Type tree representing a by name parameter */ - type TypeTree_ByName <: TypeTree + type ByName <: TypeTree - def TypeTree_ByName_result(self: TypeTree_ByName)(implicit ctx: Context): TypeTree + def ByName_result(self: ByName)(implicit ctx: Context): TypeTree - def matchTypeTree_ByName(tree: Tree)(implicit ctx: Context): Option[TypeTree_ByName] + def matchByName(tree: Tree)(implicit ctx: Context): Option[ByName] - def TypeTree_ByName_apply(result: TypeTree)(implicit ctx: Context): TypeTree_ByName - def TypeTree_ByName_copy(original: TypeTree_ByName)(result: TypeTree)(implicit ctx: Context): TypeTree_ByName + def ByName_apply(result: TypeTree)(implicit ctx: Context): ByName + def ByName_copy(original: ByName)(result: TypeTree)(implicit ctx: Context): ByName /** Type tree representing a lambda abstraction type */ - type TypeTree_LambdaTypeTree <: TypeTree + type LambdaTypeTree <: TypeTree - def matchTypeTree_LambdaTypeTree(tree: Tree)(implicit ctx: Context): Option[TypeTree_LambdaTypeTree] + def matchLambdaTypeTree(tree: Tree)(implicit ctx: Context): Option[LambdaTypeTree] - def TypeTree_LambdaTypeTree_tparams(self: TypeTree_LambdaTypeTree)(implicit ctx: Context): List[TypeDef] - def TypeTree_LambdaTypeTree_body(self: TypeTree_LambdaTypeTree)(implicit ctx: Context): Tree /*TypeTree | TypeBoundsTree*/ + def Lambdatparams(self: LambdaTypeTree)(implicit ctx: Context): List[TypeDef] + def Lambdabody(self: LambdaTypeTree)(implicit ctx: Context): Tree /*TypeTree | TypeBoundsTree*/ - def TypeTree_LambdaTypeTree_apply(tparams: List[TypeDef], body: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): TypeTree_LambdaTypeTree - def TypeTree_LambdaTypeTree_copy(original: TypeTree_LambdaTypeTree)(tparams: List[TypeDef], body: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): TypeTree_LambdaTypeTree + def Lambdaapply(tparams: List[TypeDef], body: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): LambdaTypeTree + def Lambdacopy(original: LambdaTypeTree)(tparams: List[TypeDef], body: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): LambdaTypeTree /** Type tree representing a type binding */ - type TypeTree_TypeBind <: TypeTree + type TypeBind <: TypeTree - def matchTypeTree_TypeBind(tree: Tree)(implicit ctx: Context): Option[TypeTree_TypeBind] + def matchTypeBind(tree: Tree)(implicit ctx: Context): Option[TypeBind] - def TypeTree_TypeBind_name(self: TypeTree_TypeBind)(implicit ctx: Context): String - def TypeTree_TypeBind_body(self: TypeTree_TypeBind)(implicit ctx: Context): Tree /*TypeTree | TypeBoundsTree*/ + def TypeBind_name(self: TypeBind)(implicit ctx: Context): String + def TypeBind_body(self: TypeBind)(implicit ctx: Context): Tree /*TypeTree | TypeBoundsTree*/ - def TypeTree_TypeBind_copy(original: TypeTree_TypeBind)(name: String, tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): TypeTree_TypeBind + def TypeBind_copy(original: TypeBind)(name: String, tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): TypeBind /** Type tree within a block with aliases `{ type U1 = ... ; T[U1, U2] }` */ - type TypeTree_TypeBlock <: TypeTree + type TypeBlock <: TypeTree - def matchTypeTree_TypeBlock(tree: Tree)(implicit ctx: Context): Option[TypeTree_TypeBlock] + def matchTypeBlock(tree: Tree)(implicit ctx: Context): Option[TypeBlock] - def TypeTree_TypeBlock_aliases(self: TypeTree_TypeBlock)(implicit ctx: Context): List[TypeDef] - def TypeTree_TypeBlock_tpt(self: TypeTree_TypeBlock)(implicit ctx: Context): TypeTree + def TypeBlock_aliases(self: TypeBlock)(implicit ctx: Context): List[TypeDef] + def TypeBlock_tpt(self: TypeBlock)(implicit ctx: Context): TypeTree - def TypeTree_TypeBlock_apply(aliases: List[TypeDef], tpt: TypeTree)(implicit ctx: Context): TypeTree_TypeBlock - def TypeTree_TypeBlock_copy(original: TypeTree_TypeBlock)(aliases: List[TypeDef], tpt: TypeTree)(implicit ctx: Context): TypeTree_TypeBlock + def TypeBlock_apply(aliases: List[TypeDef], tpt: TypeTree)(implicit ctx: Context): TypeBlock + def TypeBlock_copy(original: TypeBlock)(aliases: List[TypeDef], tpt: TypeTree)(implicit ctx: Context): TypeBlock /** Type tree representing a type bound written in the source */ type TypeBoundsTree <: Tree /*TypeTree | TypeBoundsTree*/ @@ -1277,7 +1277,7 @@ trait Kernel { def matchTypeBindSymbol(symbol: Symbol)(implicit ctx: Context): Option[TypeBindSymbol] /** TypeBind pattern of this definition */ - def TypeBindSymbol_tree(self: TypeBindSymbol)(implicit ctx: Context): TypeTree_TypeBind + def TypeBindSymbol_tree(self: TypeBindSymbol)(implicit ctx: Context): TypeBind type TermSymbol <: Symbol diff --git a/library/src/scala/tasty/reflect/TreeOps.scala b/library/src/scala/tasty/reflect/TreeOps.scala index 134d8a6cec15..f6d80f0d4327 100644 --- a/library/src/scala/tasty/reflect/TreeOps.scala +++ b/library/src/scala/tasty/reflect/TreeOps.scala @@ -781,251 +781,251 @@ trait TreeOps extends Core { object IsInferred { /** Matches any Inferred and returns it */ def unapply(tree: Tree)(implicit ctx: Context): Option[Inferred] = - kernel.matchTypeTree_Inferred(tree) + kernel.matchInferred(tree) } /** TypeTree containing an inferred type */ object Inferred { def apply(tpe: Type)(implicit ctx: Context): Inferred = - kernel.TypeTree_Inferred_apply(tpe) + kernel.Inferred_apply(tpe) /** Matches a TypeTree containing an inferred type */ def unapply(tree: Tree)(implicit ctx: Context): Boolean = - kernel.matchTypeTree_Inferred(tree).isDefined + kernel.matchInferred(tree).isDefined } object IsTypeIdent { /** Matches any TypeIdent and returns it */ def unapply(tree: Tree)(implicit ctx: Context): Option[TypeIdent] = - kernel.matchTypeTree_TypeIdent(tree) + kernel.matchTypeIdent(tree) } object TypeIdent { // TODO def apply(name: String)(implicit ctx: Context): TypeIdent def copy(original: TypeIdent)(name: String)(implicit ctx: Context): TypeIdent = - kernel.TypeTree_TypeIdent_copy(original)(name) + kernel.TypeIdent_copy(original)(name) def unapply(tree: Tree)(implicit ctx: Context): Option[String] = - kernel.matchTypeTree_TypeIdent(tree).map(_.name) + kernel.matchTypeIdent(tree).map(_.name) } object IsTypeSelect { /** Matches any TypeSelect and returns it */ def unapply(tree: Tree)(implicit ctx: Context): Option[TypeSelect] = - kernel.matchTypeTree_TypeSelect(tree) + kernel.matchTypeSelect(tree) } object TypeSelect { def apply(qualifier: Term, name: String)(implicit ctx: Context): TypeSelect = - kernel.TypeTree_TypeSelect_apply(qualifier, name) + kernel.TypeSelect_apply(qualifier, name) def copy(original: TypeSelect)(qualifier: Term, name: String)(implicit ctx: Context): TypeSelect = - kernel.TypeTree_TypeSelect_copy(original)(qualifier, name) + kernel.TypeSelect_copy(original)(qualifier, name) def unapply(tree: Tree)(implicit ctx: Context): Option[(Term, String)] = - kernel.matchTypeTree_TypeSelect(tree).map(x => (x.qualifier, x.name)) + kernel.matchTypeSelect(tree).map(x => (x.qualifier, x.name)) } object IsProjection { /** Matches any Projection and returns it */ def unapply(tree: Tree)(implicit ctx: Context): Option[Projection] = - kernel.matchTypeTree_Projection(tree) + kernel.matchProjection(tree) } object Projection { // TODO def apply(qualifier: TypeTree, name: String)(implicit ctx: Context): Project def copy(original: Projection)(qualifier: TypeTree, name: String)(implicit ctx: Context): Projection = - kernel.TypeTree_Projection_copy(original)(qualifier, name) + kernel.Projection_copy(original)(qualifier, name) def unapply(tree: Tree)(implicit ctx: Context): Option[(TypeTree, String)] = - kernel.matchTypeTree_Projection(tree).map(x => (x.qualifier, x.name)) + kernel.matchProjection(tree).map(x => (x.qualifier, x.name)) } object IsSingleton { /** Matches any Singleton and returns it */ def unapply(tree: Tree)(implicit ctx: Context): Option[Singleton] = - kernel.matchTypeTree_Singleton(tree) + kernel.matchSingleton(tree) } object Singleton { def apply(ref: Term)(implicit ctx: Context): Singleton = - kernel.TypeTree_Singleton_apply(ref) + kernel.Singleton_apply(ref) def copy(original: Singleton)(ref: Term)(implicit ctx: Context): Singleton = - kernel.TypeTree_Singleton_copy(original)(ref) + kernel.Singleton_copy(original)(ref) def unapply(tree: Tree)(implicit ctx: Context): Option[Term] = - kernel.matchTypeTree_Singleton(tree).map(_.ref) + kernel.matchSingleton(tree).map(_.ref) } object IsRefined { /** Matches any Refined and returns it */ def unapply(tree: Tree)(implicit ctx: Context): Option[Refined] = - kernel.matchTypeTree_Refined(tree) + kernel.matchRefined(tree) } object Refined { // TODO def apply(tpt: TypeTree, refinements: List[Definition])(implicit ctx: Context): Refined def copy(original: Refined)(tpt: TypeTree, refinements: List[Definition])(implicit ctx: Context): Refined = - kernel.TypeTree_Refined_copy(original)(tpt, refinements) + kernel.Refined_copy(original)(tpt, refinements) def unapply(tree: Tree)(implicit ctx: Context): Option[(TypeTree, List[Definition])] = - kernel.matchTypeTree_Refined(tree).map(x => (x.tpt, x.refinements)) + kernel.matchRefined(tree).map(x => (x.tpt, x.refinements)) } object IsApplied { /** Matches any Applied and returns it */ def unapply(tree: Tree)(implicit ctx: Context): Option[Applied] = - kernel.matchTypeTree_Applied(tree) + kernel.matchApplied(tree) } object Applied { def apply(tpt: TypeTree, args: List[Tree /*TypeTree | TypeBoundsTree*/])(implicit ctx: Context): Applied = - kernel.TypeTree_Applied_apply(tpt, args) + kernel.Applied_apply(tpt, args) def copy(original: Applied)(tpt: TypeTree, args: List[Tree /*TypeTree | TypeBoundsTree*/])(implicit ctx: Context): Applied = - kernel.TypeTree_Applied_copy(original)(tpt, args) + kernel.Applied_copy(original)(tpt, args) def unapply(tree: Tree)(implicit ctx: Context): Option[(TypeTree, List[Tree /*TypeTree | TypeBoundsTree*/])] = - kernel.matchTypeTree_Applied(tree).map(x => (x.tpt, x.args)) + kernel.matchApplied(tree).map(x => (x.tpt, x.args)) } object IsAnnotated { /** Matches any Annotated and returns it */ def unapply(tree: Tree)(implicit ctx: Context): Option[Annotated] = - kernel.matchTypeTree_Annotated(tree) + kernel.matchAnnotated(tree) } object Annotated { def apply(arg: TypeTree, annotation: Term)(implicit ctx: Context): Annotated = - kernel.TypeTree_Annotated_apply(arg, annotation) + kernel.Annotated_apply(arg, annotation) def copy(original: Annotated)(arg: TypeTree, annotation: Term)(implicit ctx: Context): Annotated = - kernel.TypeTree_Annotated_copy(original)(arg, annotation) + kernel.Annotated_copy(original)(arg, annotation) def unapply(tree: Tree)(implicit ctx: Context): Option[(TypeTree, Term)] = - kernel.matchTypeTree_Annotated(tree).map(x => (x.arg, x.annotation)) + kernel.matchAnnotated(tree).map(x => (x.arg, x.annotation)) } object IsMatchTypeTree { /** Matches any MatchTypeTree and returns it */ def unapply(tree: Tree)(implicit ctx: Context): Option[MatchTypeTree] = - kernel.matchTypeTree_MatchTypeTree(tree) + kernel.matchMatchTypeTree(tree) } object MatchTypeTree { def apply(bound: Option[TypeTree], selector: TypeTree, cases: List[TypeCaseDef])(implicit ctx: Context): MatchTypeTree = - kernel.TypeTree_MatchTypeTree_apply(bound, selector, cases) + kernel.MatchTypeTree_apply(bound, selector, cases) def copy(original: MatchTypeTree)(bound: Option[TypeTree], selector: TypeTree, cases: List[TypeCaseDef])(implicit ctx: Context): MatchTypeTree = - kernel.TypeTree_MatchTypeTree_copy(original)(bound, selector, cases) + kernel.MatchTypeTree_copy(original)(bound, selector, cases) def unapply(tree: Tree)(implicit ctx: Context): Option[(Option[TypeTree], TypeTree, List[TypeCaseDef])] = - kernel.matchTypeTree_MatchTypeTree(tree).map(x => (x.bound, x.selector, x.cases)) + kernel.matchMatchTypeTree(tree).map(x => (x.bound, x.selector, x.cases)) } object IsByName { /** Matches any ByName and returns it */ def unapply(tree: Tree)(implicit ctx: Context): Option[ByName] = - kernel.matchTypeTree_ByName(tree) + kernel.matchByName(tree) } object ByName { def apply(result: TypeTree)(implicit ctx: Context): ByName = - kernel.TypeTree_ByName_apply(result) + kernel.ByName_apply(result) def copy(original: ByName)(result: TypeTree)(implicit ctx: Context): ByName = - kernel.TypeTree_ByName_copy(original)(result) + kernel.ByName_copy(original)(result) def unapply(tree: Tree)(implicit ctx: Context): Option[TypeTree] = - kernel.matchTypeTree_ByName(tree).map(_.result) + kernel.matchByName(tree).map(_.result) } object IsLambdaTypeTree { /** Matches any LambdaTypeTree and returns it */ def unapply(tree: Tree)(implicit ctx: Context): Option[LambdaTypeTree] = - kernel.matchTypeTree_LambdaTypeTree(tree) + kernel.matchLambdaTypeTree(tree) } object LambdaTypeTree { def apply(tparams: List[TypeDef], body: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): LambdaTypeTree = - kernel.TypeTree_LambdaTypeTree_apply(tparams, body) + kernel.Lambdaapply(tparams, body) def copy(original: LambdaTypeTree)(tparams: List[TypeDef], body: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): LambdaTypeTree = - kernel.TypeTree_LambdaTypeTree_copy(original)(tparams, body) + kernel.Lambdacopy(original)(tparams, body) def unapply(tree: Tree)(implicit ctx: Context): Option[(List[TypeDef], Tree /*TypeTree | TypeBoundsTree*/)] = - kernel.matchTypeTree_LambdaTypeTree(tree).map(x => (x.tparams, x.body)) + kernel.matchLambdaTypeTree(tree).map(x => (x.tparams, x.body)) } object IsTypeBind { /** Matches any TypeBind and returns it */ def unapply(tree: Tree)(implicit ctx: Context): Option[TypeBind] = - kernel.matchTypeTree_TypeBind(tree) + kernel.matchTypeBind(tree) } object TypeBind { // TODO def apply(name: String, tree: Tree)(implicit ctx: Context): TypeBind def copy(original: TypeBind)(name: String, tpt: Tree /*TypeTree | TypeBoundsTree*/)(implicit ctx: Context): TypeBind = - kernel.TypeTree_TypeBind_copy(original)(name, tpt) + kernel.TypeBind_copy(original)(name, tpt) def unapply(tree: Tree)(implicit ctx: Context): Option[(String, Tree /*TypeTree | TypeBoundsTree*/)] = - kernel.matchTypeTree_TypeBind(tree).map(x => (x.name, x.body)) + kernel.matchTypeBind(tree).map(x => (x.name, x.body)) } object IsTypeBlock { /** Matches any TypeBlock and returns it */ def unapply(tree: Tree)(implicit ctx: Context): Option[TypeBlock] = - kernel.matchTypeTree_TypeBlock(tree) + kernel.matchTypeBlock(tree) } object TypeBlock { def apply(aliases: List[TypeDef], tpt: TypeTree)(implicit ctx: Context): TypeBlock = - kernel.TypeTree_TypeBlock_apply(aliases, tpt) + kernel.TypeBlock_apply(aliases, tpt) def copy(original: TypeBlock)(aliases: List[TypeDef], tpt: TypeTree)(implicit ctx: Context): TypeBlock = - kernel.TypeTree_TypeBlock_copy(original)(aliases, tpt) + kernel.TypeBlock_copy(original)(aliases, tpt) def unapply(tree: Tree)(implicit ctx: Context): Option[(List[TypeDef], TypeTree)] = - kernel.matchTypeTree_TypeBlock(tree).map(x => (x.aliases, x.tpt)) + kernel.matchTypeBlock(tree).map(x => (x.aliases, x.tpt)) } } - implicit class TypeTree_TypeIdentAPI(self: TypeTree.TypeIdent) { - def name(implicit ctx: Context): String = kernel.TypeTree_TypeIdent_name(self) + implicit class TypeIdentAPI(self: TypeTree.TypeIdent) { + def name(implicit ctx: Context): String = kernel.TypeIdent_name(self) } - implicit class TypeTree_TypeSelectAPI(self: TypeTree.TypeSelect) { - def qualifier(implicit ctx: Context): Term = kernel.TypeTree_TypeSelect_qualifier(self) - def name(implicit ctx: Context): String = kernel.TypeTree_TypeSelect_name(self) + implicit class TypeSelectAPI(self: TypeTree.TypeSelect) { + def qualifier(implicit ctx: Context): Term = kernel.TypeSelect_qualifier(self) + def name(implicit ctx: Context): String = kernel.TypeSelect_name(self) } - implicit class TypeTree_ProjectionAPI(self: TypeTree.Projection) { - def qualifier(implicit ctx: Context): TypeTree = kernel.TypeTree_Projection_qualifier(self) - def name(implicit ctx: Context): String = kernel.TypeTree_Projection_name(self) + implicit class ProjectionAPI(self: TypeTree.Projection) { + def qualifier(implicit ctx: Context): TypeTree = kernel.Projection_qualifier(self) + def name(implicit ctx: Context): String = kernel.Projection_name(self) } - implicit class TypeTree_SingletonAPI(self: TypeTree.Singleton) { - def ref(implicit ctx: Context): Term = kernel.TypeTree_Singleton_ref(self) + implicit class SingletonAPI(self: TypeTree.Singleton) { + def ref(implicit ctx: Context): Term = kernel.Singleton_ref(self) } - implicit class TypeTree_RefinedAPI(self: TypeTree.Refined) { - def tpt(implicit ctx: Context): TypeTree = kernel.TypeTree_Refined_tpt(self) - def refinements(implicit ctx: Context): List[Definition] = kernel.TypeTree_Refined_refinements(self) + implicit class RefinedAPI(self: TypeTree.Refined) { + def tpt(implicit ctx: Context): TypeTree = kernel.Refined_tpt(self) + def refinements(implicit ctx: Context): List[Definition] = kernel.Refined_refinements(self) } - implicit class TypeTree_AppliedAPI(self: TypeTree.Applied) { - def tpt(implicit ctx: Context): TypeTree = kernel.TypeTree_Applied_tpt(self) - def args(implicit ctx: Context): List[Tree /*TypeTree | TypeBoundsTree*/] = kernel.TypeTree_Applied_args(self) + implicit class AppliedAPI(self: TypeTree.Applied) { + def tpt(implicit ctx: Context): TypeTree = kernel.Applied_tpt(self) + def args(implicit ctx: Context): List[Tree /*TypeTree | TypeBoundsTree*/] = kernel.Applied_args(self) } - implicit class TypeTree_AnnotatedAPI(self: TypeTree.Annotated) { - def arg(implicit ctx: Context): TypeTree = kernel.TypeTree_Annotated_arg(self) - def annotation(implicit ctx: Context): Term = kernel.TypeTree_Annotated_annotation(self) + implicit class AnnotatedAPI(self: TypeTree.Annotated) { + def arg(implicit ctx: Context): TypeTree = kernel.Annotated_arg(self) + def annotation(implicit ctx: Context): Term = kernel.Annotated_annotation(self) } - implicit class TypeTree_MatchTypeTreeAPI(self: TypeTree.MatchTypeTree) { - def bound(implicit ctx: Context): Option[TypeTree] = kernel.TypeTree_MatchTypeTree_bound(self) - def selector(implicit ctx: Context): TypeTree = kernel.TypeTree_MatchTypeTree_selector(self) - def cases(implicit ctx: Context): List[TypeCaseDef] = kernel.TypeTree_MatchTypeTree_cases(self) + implicit class MatchTypeTreeAPI(self: TypeTree.MatchTypeTree) { + def bound(implicit ctx: Context): Option[TypeTree] = kernel.MatchTypeTree_bound(self) + def selector(implicit ctx: Context): TypeTree = kernel.MatchTypeTree_selector(self) + def cases(implicit ctx: Context): List[TypeCaseDef] = kernel.MatchTypeTree_cases(self) } - implicit class TypeTree_ByNameAPI(self: TypeTree.ByName) { - def result(implicit ctx: Context): TypeTree = kernel.TypeTree_ByName_result(self) + implicit class ByNameAPI(self: TypeTree.ByName) { + def result(implicit ctx: Context): TypeTree = kernel.ByName_result(self) } - implicit class TypeTree_LambdaTypeTreeAPI(self: TypeTree.LambdaTypeTree) { - def tparams(implicit ctx: Context): List[TypeDef] = kernel.TypeTree_LambdaTypeTree_tparams(self) - def body(implicit ctx: Context): Tree /*TypeTree | TypeBoundsTree*/ = kernel.TypeTree_LambdaTypeTree_body(self) + implicit class LambdaTypeTreeAPI(self: TypeTree.LambdaTypeTree) { + def tparams(implicit ctx: Context): List[TypeDef] = kernel.Lambdatparams(self) + def body(implicit ctx: Context): Tree /*TypeTree | TypeBoundsTree*/ = kernel.Lambdabody(self) } - implicit class TypeTree_TypeBindAPI(self: TypeTree.TypeBind) { - def name(implicit ctx: Context): String = kernel.TypeTree_TypeBind_name(self) - def body(implicit ctx: Context): Tree /*TypeTree | TypeBoundsTree*/ = kernel.TypeTree_TypeBind_body(self) + implicit class TypeBindAPI(self: TypeTree.TypeBind) { + def name(implicit ctx: Context): String = kernel.TypeBind_name(self) + def body(implicit ctx: Context): Tree /*TypeTree | TypeBoundsTree*/ = kernel.TypeBind_body(self) } - implicit class TypeTree_TypeBlockAPI(self: TypeTree.TypeBlock) { - def aliases(implicit ctx: Context): List[TypeDef] = kernel.TypeTree_TypeBlock_aliases(self) - def tpt(implicit ctx: Context): TypeTree = kernel.TypeTree_TypeBlock_tpt(self) + implicit class TypeBlockAPI(self: TypeTree.TypeBlock) { + def aliases(implicit ctx: Context): List[TypeDef] = kernel.TypeBlock_aliases(self) + def tpt(implicit ctx: Context): TypeTree = kernel.TypeBlock_tpt(self) } // ----- TypeBoundsTrees ------------------------------------------------