diff --git a/community-build/community-projects/scalatest b/community-build/community-projects/scalatest index 88ecf66d8cd5..e2d5ae643e31 160000 --- a/community-build/community-projects/scalatest +++ b/community-build/community-projects/scalatest @@ -1 +1 @@ -Subproject commit 88ecf66d8cd56b3f280492a7e0088d7db7df693b +Subproject commit e2d5ae643e3122761db9645d7cd468b90c469c1a diff --git a/compiler/src/dotty/tools/dotc/tastyreflect/KernelImpl.scala b/compiler/src/dotty/tools/dotc/tastyreflect/KernelImpl.scala index 3302855a9716..e1cfde7d7fb5 100644 --- a/compiler/src/dotty/tools/dotc/tastyreflect/KernelImpl.scala +++ b/compiler/src/dotty/tools/dotc/tastyreflect/KernelImpl.scala @@ -1455,46 +1455,15 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util. def Constant_value(const: Constant): Any = const.value def matchConstant(constant: Constant): Option[Unit | Null | Int | Boolean | Byte | Short | Int | Long | Float | Double | Char | String | Type] = - Some(constant.asInstanceOf[Unit | Null | Int | Boolean | Byte | Short | Int | Long | Float | Double | Char | String | Type]) - - def matchConstant_Unit(x: Constant): Boolean = x.tag == Constants.UnitTag - def matchConstant_Null(x: Constant): Boolean = x.tag == Constants.NullTag - def matchConstant_Boolean(x: Constant): Option[Boolean] = - if (x.tag == Constants.BooleanTag) Some(x.booleanValue) else None - def matchConstant_Byte(x: Constant): Option[Byte] = - if (x.tag == Constants.ByteTag) Some(x.byteValue) else None - def matchConstant_Short(x: Constant): Option[Short] = - if (x.tag == Constants.ShortTag) Some(x.shortValue) else None - def matchConstant_Char(x: Constant): Option[Char] = - if (x.tag == Constants.CharTag) Some(x.charValue) else None - def matchConstant_Int(x: Constant): Option[Int] = - if (x.tag == Constants.IntTag) Some(x.intValue) else None - def matchConstant_Long(x: Constant): Option[Long] = - if (x.tag == Constants.LongTag) Some(x.longValue) else None - def matchConstant_Float(x: Constant): Option[Float] = - if (x.tag == Constants.FloatTag) Some(x.floatValue) else None - def matchConstant_Double(x: Constant): Option[Double] = - if (x.tag == Constants.DoubleTag) Some(x.doubleValue) else None - def matchConstant_String(x: Constant): Option[String] = - if (x.tag == Constants.StringTag) Some(x.stringValue) else None + Some(constant.value.asInstanceOf[Unit | Null | Int | Boolean | Byte | Short | Int | Long | Float | Double | Char | String | Type]) + def matchConstant_ClassTag(x: Constant): Option[Type] = if (x.tag == Constants.ClazzTag) Some(x.typeValue) else None def Constant_apply(x: Unit | Null | Int | Boolean | Byte | Short | Int | Long | Float | Double | Char | String | Type): Constant = Constants.Constant(x) - def Constant_Unit_apply(): Constant = Constants.Constant(()) - def Constant_Null_apply(): Constant = Constants.Constant(null) - def Constant_Boolean_apply(x: Boolean): Constant = Constants.Constant(x) - def Constant_Byte_apply(x: Byte): Constant = Constants.Constant(x) - def Constant_Short_apply(x: Short): Constant = Constants.Constant(x) - def Constant_Char_apply(x: Char): Constant = Constants.Constant(x) - def Constant_Int_apply(x: Int): Constant = Constants.Constant(x) - def Constant_Long_apply(x: Long): Constant = Constants.Constant(x) - def Constant_Float_apply(x: Float): Constant = Constants.Constant(x) - def Constant_Double_apply(x: Double): Constant = Constants.Constant(x) - def Constant_String_apply(x: String): Constant = Constants.Constant(x) - def Constant_ClassTag_apply(x: scala.reflect.ClassTag[_]): Constant = Constants.Constant(x) + def Constant_ClassTag_apply(x: Type): Constant = Constants.Constant(x) // // SYMBOLS diff --git a/library/src/scala/tasty/reflect/ConstantOps.scala b/library/src/scala/tasty/reflect/ConstantOps.scala index 4b46817c7998..dbfc3c25d638 100644 --- a/library/src/scala/tasty/reflect/ConstantOps.scala +++ b/library/src/scala/tasty/reflect/ConstantOps.scala @@ -16,133 +16,10 @@ trait ConstantOps extends Core { def unapply(constant: Constant): Option[Unit | Null | Int | Boolean | Byte | Short | Int | Long | Float | Double | Char | String | Type] = kernel.matchConstant(constant) - // TODO remove all extractors bellow and use only use the two above - - /** Module of Null literals */ - object Unit { - /** Unit `()` literal */ - def apply(): Constant = - kernel.Constant_Unit_apply() - - /** Extractor for Unit literals */ - def unapply(constant: Constant): Boolean = - kernel.matchConstant_Unit(constant) - } - - /** Module of Null literals */ - object Null { - /** `null` literal */ - def apply(): Constant = - kernel.Constant_Null_apply() - - /** Extractor for Null literals */ - def unapply(constant: Constant): Boolean = - kernel.matchConstant_Null(constant) - } - - /** Module of Boolean literals */ - object Boolean { - /** Boolean literal */ - def apply(x: Boolean): Constant = - kernel.Constant_Boolean_apply(x) - - /** Extractor for Boolean literals */ - def unapply(constant: Constant): Option[Boolean] = - kernel.matchConstant_Boolean(constant) - } - - /** Module of Byte literals */ - object Byte { - /** Byte literal */ - def apply(x: Byte): Constant = - kernel.Constant_Byte_apply(x) - - /** Extractor for Byte literals */ - def unapply(constant: Constant): Option[Byte] = - kernel.matchConstant_Byte(constant) - } - - /** Module of Short literals */ - object Short { - /** Short literal */ - def apply(x: Short): Constant = - kernel.Constant_Short_apply(x) - - /** Extractor for Short literals */ - def unapply(constant: Constant): Option[Short] = - kernel.matchConstant_Short(constant) - } - - /** Module of Char literals */ - object Char { - /** Char literal */ - def apply(x: Char): Constant = - kernel.Constant_Char_apply(x) - - /** Extractor for Char literals */ - def unapply(constant: Constant): Option[Char] = - kernel.matchConstant_Char(constant) - } - - /** Module of Int literals */ - object Int { - /** Int literal */ - def apply(x: Int): Constant = - kernel.Constant_Int_apply(x) - - /** Extractor for Int literals */ - def unapply(constant: Constant): Option[Int] = - kernel.matchConstant_Int(constant) - } - - /** Module of Long literals */ - object Long { - /** Long literal */ - def apply(x: Long): Constant = - kernel.Constant_Long_apply(x) - - /** Extractor for Long literals */ - def unapply(constant: Constant): Option[Long] = - kernel.matchConstant_Long(constant) - } - - /** Module of Float literals */ - object Float { - /** Float literal */ - def apply(x: Float): Constant = - kernel.Constant_Float_apply(x) - - /** Extractor for Float literals */ - def unapply(constant: Constant): Option[Float] = - kernel.matchConstant_Float(constant) - } - - /** Module of Double literals */ - object Double { - /** Double literal */ - def apply(x: Double): Constant = - kernel.Constant_Double_apply(x) - - /** Extractor for Double literals */ - def unapply(constant: Constant): Option[Double] = - kernel.matchConstant_Double(constant) - } - - /** Module of String literals */ - object String { - /** String literal */ - def apply(x: String): Constant = - kernel.Constant_String_apply(x) - - /** Extractor for String literals */ - def unapply(constant: Constant): Option[String] = - kernel.matchConstant_String(constant) - } - /** Module of ClassTag literals */ object ClassTag { /** scala.reflect.ClassTag literal */ - def apply[T](implicit x: scala.reflect.ClassTag[T]): Constant = + def apply[T](implicit x: Type): Constant = kernel.Constant_ClassTag_apply(x) /** Extractor for ClassTag literals */ diff --git a/library/src/scala/tasty/reflect/Kernel.scala b/library/src/scala/tasty/reflect/Kernel.scala index aa795101b2c5..ec3420b63b6c 100644 --- a/library/src/scala/tasty/reflect/Kernel.scala +++ b/library/src/scala/tasty/reflect/Kernel.scala @@ -1179,32 +1179,10 @@ trait Kernel { def Constant_value(const: Constant): Any def matchConstant(constant: Constant): Option[Unit | Null | Int | Boolean | Byte | Short | Int | Long | Float | Double | Char | String | Type] - def matchConstant_Unit(constant: Constant): Boolean - def matchConstant_Null(constant: Constant): Boolean - def matchConstant_Boolean(constant: Constant): Option[Boolean] - def matchConstant_Byte(constant: Constant): Option[Byte] - def matchConstant_Short(constant: Constant): Option[Short] - def matchConstant_Char(constant: Constant): Option[Char] - def matchConstant_Int(constant: Constant): Option[Int] - def matchConstant_Long(constant: Constant): Option[Long] - def matchConstant_Float(constant: Constant): Option[Float] - def matchConstant_Double(constant: Constant): Option[Double] - def matchConstant_String(constant: Constant): Option[String] def matchConstant_ClassTag(constant: Constant): Option[Type] def Constant_apply(x: Unit | Null | Int | Boolean | Byte | Short | Int | Long | Float | Double | Char | String | Type): Constant - def Constant_Unit_apply(): Constant - def Constant_Null_apply(): Constant - def Constant_Boolean_apply(x: Boolean): Constant - def Constant_Byte_apply(x: Byte): Constant - def Constant_Short_apply(x: Short): Constant - def Constant_Char_apply(x: Char): Constant - def Constant_Int_apply(x: Int): Constant - def Constant_Long_apply(x: Long): Constant - def Constant_Float_apply(x: Float): Constant - def Constant_Double_apply(x: Double): Constant - def Constant_String_apply(x: String): Constant - def Constant_ClassTag_apply(x: scala.reflect.ClassTag[_]): Constant + def Constant_ClassTag_apply(x: Type): Constant // // SYMBOLS diff --git a/library/src/scala/tasty/reflect/Printers.scala b/library/src/scala/tasty/reflect/Printers.scala index 29d683a23081..1a6c72351b42 100644 --- a/library/src/scala/tasty/reflect/Printers.scala +++ b/library/src/scala/tasty/reflect/Printers.scala @@ -289,18 +289,20 @@ trait Printers } def visitConstant(x: Constant): Buffer = x match { - case Constant.Unit() => this += "Constant.Unit()" - case Constant.Null() => this += "Constant.Null()" - case Constant.Boolean(value) => this += "Constant.Boolean(" += value += ")" - case Constant.Byte(value) => this += "Constant.Byte(" += value += ")" - case Constant.Short(value) => this += "Constant.Short(" += value += ")" - case Constant.Char(value) => this += "Constant.Char(" += value += ")" - case Constant.Int(value) => this += "Constant.Int(" += value.toString += ")" - case Constant.Long(value) => this += "Constant.Long(" += value += ")" - case Constant.Float(value) => this += "Constant.Float(" += value += ")" - case Constant.Double(value) => this += "Constant.Double(" += value += ")" - case Constant.String(value) => this += "Constant.String(\"" += value += "\")" - case Constant.ClassTag(value) => this += "Constant.ClassTag(" += value += ")" + case Constant(()) => this += "Constant(())" + case Constant(null) => this += "Constant(null)" + case Constant(value: Boolean) => this += "Constant(" += value += ")" + case Constant(value: Byte) => this += "Constant(" += value += ": Byte)" + case Constant(value: Short) => this += "Constant(" += value += ": Short)" + case Constant(value: Char) => this += "Constant('" += value += "')" + case Constant(value: Int) => this += "Constant(" += value.toString += ")" + case Constant(value: Long) => this += "Constant(" += value += "L)" + case Constant(value: Float) => this += "Constant(" += value += "f)" + case Constant(value: Double) => this += "Constant(" += value += "d)" + case Constant(value: String) => this += "Constant(\"" += value += "\")" + case Constant.ClassTag(value) => + this += "Constant.ClassTag(" + visitType(value) += ")" } def visitType(x: TypeOrBounds): Buffer = x match { @@ -728,7 +730,7 @@ trait Printers case While(cond, body) => (cond, body) match { - case (Block(Block(Nil, body1) :: Nil, Block(Nil, cond1)), Literal(Constant.Unit())) => + case (Block(Block(Nil, body1) :: Nil, Block(Nil, cond1)), Literal(Constant(()))) => this += highlightKeyword("do ") printTree(body1) += highlightKeyword(" while ") inParens(printTree(cond1)) @@ -990,7 +992,7 @@ trait Printers while (it.hasNext) extractFlatStats(it.next()) extractFlatStats(expansion) - case Literal(Constant.Unit()) => // ignore + case Literal(Constant(())) => // ignore case stat => flatStats += stat } def extractFlatExpr(term: Term): Term = term match { @@ -1374,17 +1376,17 @@ trait Printers } def printConstant(const: Constant): Buffer = const match { - case Constant.Unit() => this += highlightLiteral("()") - case Constant.Null() => this += highlightLiteral("null") - case Constant.Boolean(v) => this += highlightLiteral(v.toString) - case Constant.Byte(v) => this += highlightLiteral(v.toString) - case Constant.Short(v) => this += highlightLiteral(v.toString) - case Constant.Int(v) => this += highlightLiteral(v.toString) - case Constant.Long(v) => this += highlightLiteral(v.toString + "L") - case Constant.Float(v) => this += highlightLiteral(v.toString + "f") - case Constant.Double(v) => this += highlightLiteral(v.toString) - case Constant.Char(v) => this += highlightString('\'' + escapedChar(v) + '\'') - case Constant.String(v) => this += highlightString('"' + escapedString(v) + '"') + case Constant(()) => this += highlightLiteral("()") + case Constant(null) => this += highlightLiteral("null") + case Constant(v: Boolean) => this += highlightLiteral(v.toString) + case Constant(v: Byte) => this += highlightLiteral(v.toString) + case Constant(v: Short) => this += highlightLiteral(v.toString) + case Constant(v: Int) => this += highlightLiteral(v.toString) + case Constant(v: Long) => this += highlightLiteral(v.toString + "L") + case Constant(v: Float) => this += highlightLiteral(v.toString + "f") + case Constant(v: Double) => this += highlightLiteral(v.toString) + case Constant(v: Char) => this += highlightString('\'' + escapedChar(v) + '\'') + case Constant(v: String) => this += highlightString('"' + escapedString(v) + '"') case Constant.ClassTag(v) => this += "classOf" inSquare(printType(v)) diff --git a/semanticdb/src/dotty/semanticdb/TastyScalaFileInferrer.scala b/semanticdb/src/dotty/semanticdb/TastyScalaFileInferrer.scala index 96ee81fedc1e..809397729c90 100644 --- a/semanticdb/src/dotty/semanticdb/TastyScalaFileInferrer.scala +++ b/semanticdb/src/dotty/semanticdb/TastyScalaFileInferrer.scala @@ -22,7 +22,7 @@ class TastyScalaFileInferrer extends TastyConsumer { cdef.symbol.annots.foreach { annot => annot match { case Apply(Select(New(t), _), - List(Literal(Constant.String(path)))) + List(Literal(Constant(path: String)))) if t.symbol.name == "SourceFile" => // we found the path to a file. In this case, we do not need to // continue traversing the tree diff --git a/tests/pos-macros/tasty-constant-type/Macro_1.scala b/tests/pos-macros/tasty-constant-type/Macro_1.scala index 934b6d51f727..15117836e740 100644 --- a/tests/pos-macros/tasty-constant-type/Macro_1.scala +++ b/tests/pos-macros/tasty-constant-type/Macro_1.scala @@ -9,10 +9,10 @@ object Macro { def impl[A <: Int : Type, B <: Int : Type](a: Type[A], b: Type[B]) given (qctx: QuoteContext): Expr[AddInt[A, B]] = { import qctx.tasty._ - val Type.ConstantType(Constant.Int(v1)) = a.unseal.tpe - val Type.ConstantType(Constant.Int(v2)) = b.unseal.tpe + val Type.ConstantType(Constant(v1: Int)) = a.unseal.tpe + val Type.ConstantType(Constant(v2: Int)) = b.unseal.tpe - val t = Literal(Constant.Int(v1 + v2)).tpe.seal + val t = Literal(Constant((v1 + v2): Int)).tpe.seal '{ null: AddInt[$a, $b] { type Out = $t } } } 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 ed1be985fd0b..6d640b4ee1bc 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, TypeIdent("Int"), Some(Apply(Select(Literal(Constant.Int(1)), "+"), List(Literal(Constant.Int(2)))))) -ValDef("bar", TypeIdent("Int"), Some(Apply(Select(Literal(Constant.Int(2)), "+"), List(Literal(Constant.Int(3)))))) +DefDef("foo", Nil, Nil, TypeIdent("Int"), Some(Apply(Select(Literal(Constant(1)), "+"), List(Literal(Constant(2)))))) +ValDef("bar", TypeIdent("Int"), Some(Apply(Select(Literal(Constant(2)), "+"), List(Literal(Constant(3)))))) Pattern.Bind("x", Pattern.WildcardPattern()) 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 335a80717346..83c5fcea1695 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, TypeIdent("Int"), Some(Apply(Select(Literal(Constant.Int(1)), "+"), List(Literal(Constant.Int(2)))))) -ValDef("bar", TypeIdent("Int"), Some(Apply(Select(Literal(Constant.Int(2)), "+"), List(Literal(Constant.Int(3)))))) +DefDef("foo", Nil, Nil, TypeIdent("Int"), Some(Apply(Select(Literal(Constant(1)), "+"), List(Literal(Constant(2)))))) +ValDef("bar", TypeIdent("Int"), Some(Apply(Select(Literal(Constant(2)), "+"), List(Literal(Constant(3)))))) diff --git a/tests/run-macros/f-interpolation-1/FQuote_1.scala b/tests/run-macros/f-interpolation-1/FQuote_1.scala index e86e129e5cc2..f7c389934451 100644 --- a/tests/run-macros/f-interpolation-1/FQuote_1.scala +++ b/tests/run-macros/f-interpolation-1/FQuote_1.scala @@ -37,7 +37,7 @@ object FQuote { if isSCOpsConversion(conv) && isStringContextApply(fun) && values.forall(isStringConstant) => - values.collect { case Literal(Constant.String(value)) => value } + values.collect { case Literal(Constant(value: String)) => value } case tree => QuoteError(s"String literal expected, but ${tree.showExtractors} found") } diff --git a/tests/run-macros/i5119.check b/tests/run-macros/i5119.check index 90c98e0a2c3b..121a865ee6e2 100644 --- a/tests/run-macros/i5119.check +++ b/tests/run-macros/i5119.check @@ -1,2 +1,2 @@ -Select(Typed(Apply(Select(New(TypeIdent("StringContextOps")), ""), List(Apply(Select(Select(Select(Ident("_root_"), "scala"), "StringContext"), "apply"), List(Typed(Repeated(List(Literal(Constant.String("Hello World ")), Literal(Constant.String("!"))), Inferred()), Inferred()))))), TypeIdent("StringContextOps")), "inline$sc") -Typed(Repeated(List(Literal(Constant.Int(1))), Inferred()), Inferred()) +Select(Typed(Apply(Select(New(TypeIdent("StringContextOps")), ""), List(Apply(Select(Select(Select(Ident("_root_"), "scala"), "StringContext"), "apply"), List(Typed(Repeated(List(Literal(Constant("Hello World ")), Literal(Constant("!"))), Inferred()), Inferred()))))), TypeIdent("StringContextOps")), "inline$sc") +Typed(Repeated(List(Literal(Constant(1))), Inferred()), Inferred()) diff --git a/tests/run-macros/i5119b.check b/tests/run-macros/i5119b.check index 3e1f5cde7707..0a12abae43ae 100644 --- a/tests/run-macros/i5119b.check +++ b/tests/run-macros/i5119b.check @@ -1,4 +1,4 @@ -Apply(Ident("foo"), List(Literal(Constant.Int(1)))) -Apply(Ident("foo"), List(Literal(Constant.Int(2)))) -Apply(Ident("foo"), List(Literal(Constant.Int(4)))) -Apply(Ident("foo"), List(Literal(Constant.Int(3)))) +Apply(Ident("foo"), List(Literal(Constant(1)))) +Apply(Ident("foo"), List(Literal(Constant(2)))) +Apply(Ident("foo"), List(Literal(Constant(4)))) +Apply(Ident("foo"), List(Literal(Constant(3)))) diff --git a/tests/run-macros/tasty-argument-tree-1.check b/tests/run-macros/tasty-argument-tree-1.check index e72a126900a5..b8a57f737c5c 100644 --- a/tests/run-macros/tasty-argument-tree-1.check +++ b/tests/run-macros/tasty-argument-tree-1.check @@ -1,15 +1,15 @@ -tree: Inlined(None, Nil, Literal(Constant.Int(3))) -tree deref. vals: Literal(Constant.Int(3)) +tree: Inlined(None, Nil, Literal(Constant(3))) +tree deref. vals: Literal(Constant(3)) tree: Inlined(None, Nil, Ident("v")) -tree deref. vals: Literal(Constant.Int(1)) +tree deref. vals: Literal(Constant(1)) tree: Inlined(None, Nil, Ident("x")) -tree deref. vals: Literal(Constant.Int(2)) +tree deref. vals: Literal(Constant(2)) tree: Inlined(None, Nil, Ident("l")) -tree deref. vals: Literal(Constant.Int(3)) +tree deref. vals: Literal(Constant(3)) tree: Inlined(None, Nil, Ident("a")) tree deref. vals: Ident("a") @@ -21,22 +21,22 @@ tree: Inlined(None, Nil, Ident("x")) tree deref. vals: Apply(Ident("d2"), Nil) tree: Inlined(None, Nil, Ident("x")) -tree deref. vals: Apply(Ident("d3"), List(Literal(Constant.Int(3)))) +tree deref. vals: Apply(Ident("d3"), List(Literal(Constant(3)))) tree: Inlined(None, Nil, Ident("x")) tree deref. vals: TypeApply(Ident("d4"), List(TypeIdent("Int"))) tree: Inlined(None, Nil, Ident("vv")) -tree deref. vals: Literal(Constant.Int(1)) +tree deref. vals: Literal(Constant(1)) tree: Inlined(None, Nil, Ident("x")) -tree deref. vals: Literal(Constant.Int(1)) +tree deref. vals: Literal(Constant(1)) tree: Inlined(None, Nil, Ident("vd")) -tree deref. vals: Literal(Constant.Int(2)) +tree deref. vals: Literal(Constant(2)) tree: Inlined(None, Nil, Ident("x")) -tree deref. vals: Literal(Constant.Int(2)) +tree deref. vals: Literal(Constant(2)) tree: Inlined(None, Nil, Ident("x")) -tree deref. vals: Apply(TypeApply(Select(Ident("Tuple2"), "apply"), List(Inferred(), Inferred())), List(Literal(Constant.Int(1)), Literal(Constant.Int(2)))) +tree deref. vals: Apply(TypeApply(Select(Ident("Tuple2"), "apply"), List(Inferred(), Inferred())), List(Literal(Constant(1)), Literal(Constant(2)))) diff --git a/tests/run-macros/tasty-eval/quoted_1.scala b/tests/run-macros/tasty-eval/quoted_1.scala index 4352ea44fe69..55b546c9045b 100644 --- a/tests/run-macros/tasty-eval/quoted_1.scala +++ b/tests/run-macros/tasty-eval/quoted_1.scala @@ -23,10 +23,10 @@ object Macros { e.unseal.tpe match { case Type.SymRef(IsValDefSymbol(sym), pre) => sym.tree.tpt.tpe match { - case Type.ConstantType(Constant.Int(i)) => Some(i) + case Type.ConstantType(Constant(i: Int)) => Some(i) case _ => None } - case Type.ConstantType(Constant.Int(i)) => Some(i) + case Type.ConstantType(Constant(i: Int)) => Some(i) case _ => None } } diff --git a/tests/run-macros/tasty-extractors-1.check b/tests/run-macros/tasty-extractors-1.check index 21105a0af06f..849fda272e9e 100644 --- a/tests/run-macros/tasty-extractors-1.check +++ b/tests/run-macros/tasty-extractors-1.check @@ -1,120 +1,120 @@ -Inlined(None, Nil, Literal(Constant.Boolean(true))) -Type.ConstantType(Constant.Boolean(true)) +Inlined(None, Nil, Literal(Constant(true))) +Type.ConstantType(Constant(true)) -Inlined(None, Nil, Literal(Constant.Int(1))) -Type.ConstantType(Constant.Int(1)) +Inlined(None, Nil, Literal(Constant(1))) +Type.ConstantType(Constant(1)) -Inlined(None, Nil, Literal(Constant.Long(2))) -Type.ConstantType(Constant.Long(2)) +Inlined(None, Nil, Literal(Constant(2L))) +Type.ConstantType(Constant(2L)) -Inlined(None, Nil, Literal(Constant.Float(2.1))) -Type.ConstantType(Constant.Float(2.1)) +Inlined(None, Nil, Literal(Constant(2.1f))) +Type.ConstantType(Constant(2.1f)) -Inlined(None, Nil, Literal(Constant.Double(2.2))) -Type.ConstantType(Constant.Double(2.2)) +Inlined(None, Nil, Literal(Constant(2.2d))) +Type.ConstantType(Constant(2.2d)) -Inlined(None, Nil, Literal(Constant.String("abc"))) -Type.ConstantType(Constant.String("abc")) +Inlined(None, Nil, Literal(Constant("abc"))) +Type.ConstantType(Constant("abc")) -Inlined(None, Nil, Apply(Ident("println"), List(Literal(Constant.String("abc"))))) +Inlined(None, Nil, Apply(Ident("println"), List(Literal(Constant("abc"))))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Typed(Literal(Constant.Int(8)), TypeIdent("Int"))) +Inlined(None, Nil, Typed(Literal(Constant(8)), TypeIdent("Int"))) Type.SymRef(IsClassDefSymbol(), Type.SymRef(IsPackageDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(<>), NoPrefix())))) -Inlined(None, Nil, Typed(Literal(Constant.Byte(8)), TypeIdent("Byte"))) +Inlined(None, Nil, Typed(Literal(Constant(8: Byte)), TypeIdent("Byte"))) Type.SymRef(IsClassDefSymbol(), Type.SymRef(IsPackageDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(<>), NoPrefix())))) -Inlined(None, Nil, Typed(Literal(Constant.Short(8)), TypeIdent("Short"))) +Inlined(None, Nil, Typed(Literal(Constant(8: Short)), TypeIdent("Short"))) Type.SymRef(IsClassDefSymbol(), Type.SymRef(IsPackageDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(<>), NoPrefix())))) -Inlined(None, Nil, Literal(Constant.Char(a))) -Type.ConstantType(Constant.Char(a)) +Inlined(None, Nil, Literal(Constant('a'))) +Type.ConstantType(Constant('a')) -Inlined(None, Nil, Block(List(Literal(Constant.Int(1)), Literal(Constant.Int(2))), Literal(Constant.Int(3)))) -Type.ConstantType(Constant.Int(3)) +Inlined(None, Nil, Block(List(Literal(Constant(1)), Literal(Constant(2))), Literal(Constant(3)))) +Type.ConstantType(Constant(3)) -Inlined(None, Nil, If(Typed(Literal(Constant.Boolean(true)), TypeIdent("Boolean")), Literal(Constant.Int(1)), Literal(Constant.Int(2)))) -Type.OrType(Type.ConstantType(Constant.Int(1)), Type.ConstantType(Constant.Int(2))) +Inlined(None, Nil, If(Typed(Literal(Constant(true)), TypeIdent("Boolean")), Literal(Constant(1)), Literal(Constant(2)))) +Type.OrType(Type.ConstantType(Constant(1)), Type.ConstantType(Constant(2))) -Inlined(None, Nil, Match(Literal(Constant.String("a")), List(CaseDef(Pattern.Value(Literal(Constant.String("a"))), None, Block(Nil, Literal(Constant.Unit())))))) +Inlined(None, Nil, Match(Literal(Constant("a")), List(CaseDef(Pattern.Value(Literal(Constant("a"))), None, Block(Nil, Literal(Constant(()))))))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Match(Literal(Constant.String("b")), List(CaseDef(Pattern.Bind("n", Pattern.WildcardPattern()), None, Block(Nil, Literal(Constant.Unit())))))) +Inlined(None, Nil, Match(Literal(Constant("b")), List(CaseDef(Pattern.Bind("n", Pattern.WildcardPattern()), None, Block(Nil, Literal(Constant(()))))))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Match(Literal(Constant.String("c")), List(CaseDef(Pattern.Bind("n", Pattern.TypeTest(TypeIdent("String"))), None, Block(Nil, Literal(Constant.Unit())))))) +Inlined(None, Nil, Match(Literal(Constant("c")), List(CaseDef(Pattern.Bind("n", Pattern.TypeTest(TypeIdent("String"))), None, Block(Nil, Literal(Constant(()))))))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Match(Literal(Constant.String("e")), List(CaseDef(Pattern.WildcardPattern(), None, Block(Nil, Literal(Constant.Unit())))))) +Inlined(None, Nil, Match(Literal(Constant("e")), List(CaseDef(Pattern.WildcardPattern(), None, Block(Nil, Literal(Constant(()))))))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Match(Literal(Constant.String("f")), List(CaseDef(Pattern.TypeTest(TypeIdent("String")), None, Block(Nil, Literal(Constant.Unit())))))) +Inlined(None, Nil, Match(Literal(Constant("f")), List(CaseDef(Pattern.TypeTest(TypeIdent("String")), None, Block(Nil, Literal(Constant(()))))))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Match(Typed(Literal(Constant.String("g")), TypeIdent("Any")), List(CaseDef(Pattern.Alternative(List(Pattern.TypeTest(TypeIdent("String")), Pattern.TypeTest(TypeIdent("Int")))), None, Block(Nil, Literal(Constant.Unit())))))) +Inlined(None, Nil, Match(Typed(Literal(Constant("g")), TypeIdent("Any")), List(CaseDef(Pattern.Alternative(List(Pattern.TypeTest(TypeIdent("String")), Pattern.TypeTest(TypeIdent("Int")))), None, Block(Nil, Literal(Constant(()))))))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Match(Literal(Constant.String("h")), List(CaseDef(Pattern.WildcardPattern(), Some(Literal(Constant.Boolean(false))), Block(Nil, Literal(Constant.Unit())))))) +Inlined(None, Nil, Match(Literal(Constant("h")), List(CaseDef(Pattern.WildcardPattern(), Some(Literal(Constant(false))), Block(Nil, Literal(Constant(()))))))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ValDef("a", Inferred(), Some(Literal(Constant.String("o"))))), Match(Literal(Constant.String("i")), List(CaseDef(Pattern.Bind("a", Pattern.WildcardPattern()), None, Block(Nil, Literal(Constant.Unit()))))))) +Inlined(None, Nil, Block(List(ValDef("a", Inferred(), Some(Literal(Constant("o"))))), Match(Literal(Constant("i")), List(CaseDef(Pattern.Bind("a", Pattern.WildcardPattern()), None, Block(Nil, Literal(Constant(())))))))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Match(Ident("Nil"), List(CaseDef(Pattern.Unapply(TypeApply(Select(Ident("List"), "unapplySeq"), List(Inferred())), Nil, List(Pattern.Bind("a", Pattern.WildcardPattern()), Pattern.Bind("b", Pattern.WildcardPattern()), Pattern.Bind("c", Pattern.WildcardPattern()))), None, Block(Nil, Literal(Constant.Unit())))))) +Inlined(None, Nil, Match(Ident("Nil"), List(CaseDef(Pattern.Unapply(TypeApply(Select(Ident("List"), "unapplySeq"), List(Inferred())), Nil, List(Pattern.Bind("a", Pattern.WildcardPattern()), Pattern.Bind("b", Pattern.WildcardPattern()), Pattern.Bind("c", Pattern.WildcardPattern()))), None, Block(Nil, Literal(Constant(()))))))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Try(Literal(Constant.Int(1)), List(CaseDef(Pattern.WildcardPattern(), None, Block(Nil, Literal(Constant.Unit())))), None)) -Type.OrType(Type.ConstantType(Constant.Int(1)), Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix())))) +Inlined(None, Nil, Try(Literal(Constant(1)), List(CaseDef(Pattern.WildcardPattern(), None, Block(Nil, Literal(Constant(()))))), None)) +Type.OrType(Type.ConstantType(Constant(1)), Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix())))) -Inlined(None, Nil, Try(Literal(Constant.Int(2)), Nil, Some(Literal(Constant.Unit())))) -Type.ConstantType(Constant.Int(2)) +Inlined(None, Nil, Try(Literal(Constant(2)), Nil, Some(Literal(Constant(()))))) +Type.ConstantType(Constant(2)) -Inlined(None, Nil, Try(Literal(Constant.Int(3)), List(CaseDef(Pattern.WildcardPattern(), None, Block(Nil, Literal(Constant.Unit())))), Some(Literal(Constant.Unit())))) -Type.OrType(Type.ConstantType(Constant.Int(3)), Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix())))) +Inlined(None, Nil, Try(Literal(Constant(3)), List(CaseDef(Pattern.WildcardPattern(), None, Block(Nil, Literal(Constant(()))))), Some(Literal(Constant(()))))) +Type.OrType(Type.ConstantType(Constant(3)), Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix())))) -Inlined(None, Nil, Apply(Select(Literal(Constant.String("a")), "=="), List(Literal(Constant.String("b"))))) +Inlined(None, Nil, Apply(Select(Literal(Constant("a")), "=="), List(Literal(Constant("b"))))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) Inlined(None, Nil, Apply(Select(New(TypeIdent("Object")), ""), Nil)) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Apply(Select(Ident("Int"), "box"), List(NamedArg("x", Literal(Constant.Int(9)))))) +Inlined(None, Nil, Apply(Select(Ident("Int"), "box"), List(NamedArg("x", Literal(Constant(9)))))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) Inlined(None, Nil, Apply(TypeApply(Select(Ident("Ordering"), "apply"), List(TypeIdent("Int"))), List(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())))))) -Inlined(None, Nil, Block(List(ValDef("a", TypeIdent("Int"), Some(Literal(Constant.Int(3))))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ValDef("a", TypeIdent("Int"), Some(Literal(Constant(3))))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ValDef("b", TypeIdent("Int"), Some(Literal(Constant.Int(3))))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ValDef("b", TypeIdent("Int"), Some(Literal(Constant(3))))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(DefDef("f1", Nil, Nil, TypeIdent("Int"), Some(Literal(Constant.Int(3))))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(DefDef("f1", Nil, Nil, TypeIdent("Int"), Some(Literal(Constant(3))))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(DefDef("f2", Nil, Nil, TypeIdent("Int"), Some(Return(Literal(Constant.Int(4)))))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(DefDef("f2", Nil, Nil, TypeIdent("Int"), Some(Return(Literal(Constant(4)))))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(DefDef("f3", Nil, List(List(ValDef("i", TypeIdent("Int"), None))), TypeIdent("Int"), Some(Ident("i")))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(DefDef("f3", Nil, List(List(ValDef("i", TypeIdent("Int"), None))), TypeIdent("Int"), Some(Ident("i")))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(DefDef("f4", Nil, List(List(ValDef("i", TypeIdent("Int"), None)), List(ValDef("j", TypeIdent("Int"), None))), TypeIdent("Int"), Some(Apply(Select(Ident("i"), "+"), List(Ident("j")))))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(DefDef("f4", Nil, List(List(ValDef("i", TypeIdent("Int"), None)), List(ValDef("j", TypeIdent("Int"), None))), TypeIdent("Int"), Some(Apply(Select(Ident("i"), "+"), List(Ident("j")))))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(DefDef("f5", Nil, List(List(ValDef("i", TypeIdent("Int"), None))), TypeIdent("Int"), Some(Ident("i"))), DefDef("f5$default$1", Nil, Nil, Inferred(), Some(Literal(Constant.Int(9))))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(DefDef("f5", Nil, List(List(ValDef("i", TypeIdent("Int"), None))), TypeIdent("Int"), Some(Ident("i"))), DefDef("f5$default$1", Nil, Nil, Inferred(), Some(Literal(Constant(9))))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(DefDef("f6", List(TypeDef("T", TypeBoundsTree(Inferred(), Inferred()))), List(List(ValDef("x", TypeIdent("T"), None))), TypeIdent("T"), Some(Ident("x")))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(DefDef("f6", List(TypeDef("T", TypeBoundsTree(Inferred(), Inferred()))), List(List(ValDef("x", TypeIdent("T"), None))), TypeIdent("T"), Some(Ident("x")))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(DefDef("f7", List(TypeDef("T", TypeBoundsTree(Inferred(), Inferred()))), List(List(ValDef("x", TypeIdent("T"), None))), Singleton(Ident("x")), Some(Ident("x")))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(DefDef("f7", List(TypeDef("T", TypeBoundsTree(Inferred(), Inferred()))), List(List(ValDef("x", TypeIdent("T"), None))), Singleton(Ident("x")), Some(Ident("x")))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(DefDef("f8", Nil, List(List(ValDef("i", Annotated(Applied(Inferred(), List(TypeIdent("Int"))), Apply(Select(New(Inferred()), ""), Nil)), None))), TypeIdent("Int"), Some(Literal(Constant.Int(9))))), Apply(Ident("f8"), List(Typed(Repeated(List(Literal(Constant.Int(1)), Literal(Constant.Int(2)), Literal(Constant.Int(3))), Inferred()), Inferred()))))) +Inlined(None, Nil, Block(List(DefDef("f8", Nil, List(List(ValDef("i", Annotated(Applied(Inferred(), List(TypeIdent("Int"))), Apply(Select(New(Inferred()), ""), Nil)), None))), TypeIdent("Int"), Some(Literal(Constant(9))))), Apply(Ident("f8"), List(Typed(Repeated(List(Literal(Constant(1)), Literal(Constant(2)), Literal(Constant(3))), Inferred()), Inferred()))))) Type.SymRef(IsClassDefSymbol(), Type.SymRef(IsPackageDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(<>), NoPrefix())))) -Inlined(None, Nil, Block(List(DefDef("f9", Nil, List(List(ValDef("i", ByName(TypeIdent("Int")), None))), TypeIdent("Int"), Some(Ident("i")))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(DefDef("f9", Nil, List(List(ValDef("i", ByName(TypeIdent("Int")), None))), TypeIdent("Int"), Some(Ident("i")))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) diff --git a/tests/run-macros/tasty-extractors-2.check b/tests/run-macros/tasty-extractors-2.check index cefe2ade91f3..f6c53839ddd8 100644 --- a/tests/run-macros/tasty-extractors-2.check +++ b/tests/run-macros/tasty-extractors-2.check @@ -1,4 +1,4 @@ -Inlined(None, Nil, Block(List(ValDef("x", Inferred(), Some(Literal(Constant.Int(1))))), Assign(Ident("x"), Literal(Constant.Int(2))))) +Inlined(None, Nil, Block(List(ValDef("x", Inferred(), Some(Literal(Constant(1))))), Assign(Ident("x"), Literal(Constant(2))))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) Inlined(None, Nil, Block(List(DefDef("$anonfun", Nil, List(List(ValDef("x", TypeIdent("Int"), None))), Inferred(), Some(Ident("x")))), Lambda(Ident("$anonfun"), None))) @@ -7,10 +7,10 @@ Type.AppliedType(Type.SymRef(IsClassDefSymbol(), Type.ThisType( Inlined(None, Nil, Ident("???")) Type.SymRef(IsDefDefSymbol(), Type.SymRef(IsValDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix())))) -Inlined(None, Nil, Literal(Constant.Int(1))) -Type.ConstantType(Constant.Int(1)) +Inlined(None, Nil, Literal(Constant(1))) +Type.ConstantType(Constant(1)) -Inlined(None, Nil, Typed(Literal(Constant.Int(1)), TypeIdent("Int"))) +Inlined(None, Nil, Typed(Literal(Constant(1)), TypeIdent("Int"))) Type.SymRef(IsClassDefSymbol(), Type.SymRef(IsPackageDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(<>), NoPrefix())))) Inlined(None, Nil, Typed(Ident("Nil"), Applied(TypeIdent("List"), List(TypeIdent("Int"))))) @@ -19,87 +19,87 @@ Type.AppliedType(Type.SymRef(IsClassDefSymbol() Inlined(None, Nil, Typed(Apply(Select(New(TypeIdent("Baz")), ""), Nil), Applied(TypeIdent("&"), List(TypeIdent("Foo"), TypeIdent("Bar"))))) Type.AndType(Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(<>), NoPrefix()))), Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(<>), NoPrefix())))) -Inlined(None, Nil, Typed(Literal(Constant.Int(1)), Applied(TypeIdent("|"), List(TypeIdent("Int"), TypeIdent("String"))))) +Inlined(None, Nil, Typed(Literal(Constant(1)), Applied(TypeIdent("|"), List(TypeIdent("Int"), 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()))))) -Inlined(None, Nil, Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, Nil)), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, Nil)), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ValDef("Foo", TypeIdent("Foo$"), Some(Apply(Select(New(TypeIdent("Foo$")), ""), Nil))), ClassDef("Foo$", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil), TypeSelect(Select(Ident("_root_"), "scala"), "Serializable")), Nil, Some(ValDef("_", Singleton(Ident("Foo")), None)), Nil)), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ValDef("Foo", TypeIdent("Foo$"), Some(Apply(Select(New(TypeIdent("Foo$")), ""), Nil))), ClassDef("Foo$", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil), TypeSelect(Select(Ident("_root_"), "scala"), "Serializable")), Nil, Some(ValDef("_", Singleton(Ident("Foo")), None)), Nil)), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(TypeDef("Foo", TypeBoundsTree(Inferred(), Inferred()))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(TypeDef("Foo", TypeBoundsTree(Inferred(), Inferred()))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(TypeDef("Foo", TypeIdent("Int"))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(TypeDef("Foo", TypeIdent("Int"))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(TypeDef("Foo", TypeBoundsTree(TypeIdent("Null"), TypeIdent("Object")))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(TypeDef("Foo", TypeBoundsTree(TypeIdent("Null"), TypeIdent("Object")))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("a", Inferred(), Some(Literal(Constant.Int(0)))), DefDef("a_=", Nil, List(List(ValDef("x$1", Inferred(), None))), Inferred(), Some(Literal(Constant.Unit())))))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("a", Inferred(), Some(Literal(Constant(0)))), DefDef("a_=", Nil, List(List(ValDef("x$1", Inferred(), None))), Inferred(), Some(Literal(Constant(()))))))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(DefDef("a", Nil, Nil, Inferred(), Some(Literal(Constant.Int(0))))))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(DefDef("a", Nil, Nil, Inferred(), Some(Literal(Constant(0))))))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(DefDef("a", Nil, Nil, Inferred(), Some(Literal(Constant.Int(0))))))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(DefDef("a", Nil, Nil, Inferred(), Some(Literal(Constant(0))))))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(DefDef("a", Nil, Nil, Inferred(), Some(Literal(Constant.Int(0))))))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(DefDef("a", Nil, Nil, Inferred(), Some(Literal(Constant(0))))))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil), TypeSelect(Select(Ident("_root_"), "scala"), "Product"), TypeSelect(Select(Ident("_root_"), "scala"), "Serializable")), Nil, None, List(DefDef("productElementName", Nil, List(List(ValDef("x$1", TypeSelect(Select(Ident("_root_"), "scala"), "Int"), None))), TypeSelect(Select(Ident("java"), "lang"), "String"), Some(Match(Ident("x$1"), List(CaseDef(Pattern.WildcardPattern(), None, Apply(Ident("throw"), List(Apply(Select(New(TypeSelect(Select(Ident("java"), "lang"), "IndexOutOfBoundsException")), ""), List(Apply(Select(Select(Select(Ident("java"), "lang"), "String"), "valueOf"), List(Ident("x$1")))))))))))), DefDef("copy", Nil, List(Nil), Inferred(), Some(Apply(Select(New(Inferred()), ""), Nil))))), ValDef("Foo", TypeIdent("Foo$"), Some(Apply(Select(New(TypeIdent("Foo$")), ""), Nil))), ClassDef("Foo$", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil), Applied(Inferred(), List(Inferred())), TypeSelect(Select(Ident("_root_"), "scala"), "Serializable")), Nil, Some(ValDef("_", Singleton(Ident("Foo")), None)), List(DefDef("apply", Nil, List(Nil), Inferred(), Some(Apply(Select(New(Inferred()), ""), Nil))), DefDef("unapply", Nil, List(List(ValDef("x$1", Inferred(), None))), Inferred(), Some(Literal(Constant.Boolean(true))))))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil), TypeSelect(Select(Ident("_root_"), "scala"), "Product"), TypeSelect(Select(Ident("_root_"), "scala"), "Serializable")), Nil, None, List(DefDef("productElementName", Nil, List(List(ValDef("x$1", TypeSelect(Select(Ident("_root_"), "scala"), "Int"), None))), TypeSelect(Select(Ident("java"), "lang"), "String"), Some(Match(Ident("x$1"), List(CaseDef(Pattern.WildcardPattern(), None, Apply(Ident("throw"), List(Apply(Select(New(TypeSelect(Select(Ident("java"), "lang"), "IndexOutOfBoundsException")), ""), List(Apply(Select(Select(Select(Ident("java"), "lang"), "String"), "valueOf"), List(Ident("x$1")))))))))))), DefDef("copy", Nil, List(Nil), Inferred(), Some(Apply(Select(New(Inferred()), ""), Nil))))), ValDef("Foo", TypeIdent("Foo$"), Some(Apply(Select(New(TypeIdent("Foo$")), ""), Nil))), ClassDef("Foo$", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil), Applied(Inferred(), List(Inferred())), TypeSelect(Select(Ident("_root_"), "scala"), "Serializable")), Nil, Some(ValDef("_", Singleton(Ident("Foo")), None)), List(DefDef("apply", Nil, List(Nil), Inferred(), Some(Apply(Select(New(Inferred()), ""), Nil))), DefDef("unapply", Nil, List(List(ValDef("x$1", Inferred(), None))), Inferred(), Some(Literal(Constant(true))))))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ClassDef("Foo1", DefDef("", Nil, List(List(ValDef("a", TypeIdent("Int"), None))), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("a", Inferred(), None)))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ClassDef("Foo1", DefDef("", Nil, List(List(ValDef("a", TypeIdent("Int"), None))), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("a", Inferred(), None)))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ClassDef("Foo2", DefDef("", Nil, List(List(ValDef("b", TypeIdent("Int"), None))), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("b", Inferred(), None)))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ClassDef("Foo2", DefDef("", Nil, List(List(ValDef("b", TypeIdent("Int"), None))), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("b", Inferred(), None)))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ClassDef("Foo3", DefDef("", Nil, List(List(ValDef("a", TypeIdent("Int"), None))), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("a", Inferred(), None))), ValDef("Foo3", TypeIdent("Foo3$"), Some(Apply(Select(New(TypeIdent("Foo3$")), ""), Nil))), ClassDef("Foo3$", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil), TypeSelect(Select(Ident("_root_"), "scala"), "Serializable")), Nil, Some(ValDef("_", Singleton(Ident("Foo3")), None)), List(DefDef("$lessinit$greater$default$1", Nil, Nil, Inferred(), Some(Literal(Constant.Int(5))))))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ClassDef("Foo3", DefDef("", Nil, List(List(ValDef("a", TypeIdent("Int"), None))), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("a", Inferred(), None))), ValDef("Foo3", TypeIdent("Foo3$"), Some(Apply(Select(New(TypeIdent("Foo3$")), ""), Nil))), ClassDef("Foo3$", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil), TypeSelect(Select(Ident("_root_"), "scala"), "Serializable")), Nil, Some(ValDef("_", Singleton(Ident("Foo3")), None)), List(DefDef("$lessinit$greater$default$1", Nil, Nil, Inferred(), Some(Literal(Constant(5))))))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ClassDef("Foo4", DefDef("", Nil, List(List(ValDef("a", TypeIdent("Int"), None)), List(ValDef("b", TypeIdent("Int"), None))), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("a", Inferred(), None), ValDef("b", Inferred(), None)))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ClassDef("Foo4", DefDef("", Nil, List(List(ValDef("a", TypeIdent("Int"), None)), List(ValDef("b", TypeIdent("Int"), None))), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("a", Inferred(), None), ValDef("b", Inferred(), None)))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ClassDef("Foo5", DefDef("", Nil, List(List(ValDef("a", TypeIdent("Int"), None)), List(ValDef("b", TypeIdent("Int"), None))), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("a", Inferred(), None), ValDef("b", Inferred(), None))), ValDef("Foo5", TypeIdent("Foo5$"), Some(Apply(Select(New(TypeIdent("Foo5$")), ""), Nil))), ClassDef("Foo5$", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil), TypeSelect(Select(Ident("_root_"), "scala"), "Serializable")), Nil, Some(ValDef("_", Singleton(Ident("Foo5")), None)), List(DefDef("$lessinit$greater$default$2", Nil, List(List(ValDef("a", TypeIdent("Int"), None))), Inferred(), Some(Ident("a")))))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ClassDef("Foo5", DefDef("", Nil, List(List(ValDef("a", TypeIdent("Int"), None)), List(ValDef("b", TypeIdent("Int"), None))), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("a", Inferred(), None), ValDef("b", Inferred(), None))), ValDef("Foo5", TypeIdent("Foo5$"), Some(Apply(Select(New(TypeIdent("Foo5$")), ""), Nil))), ClassDef("Foo5$", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil), TypeSelect(Select(Ident("_root_"), "scala"), "Serializable")), Nil, Some(ValDef("_", Singleton(Ident("Foo5")), None)), List(DefDef("$lessinit$greater$default$2", Nil, List(List(ValDef("a", TypeIdent("Int"), None))), Inferred(), Some(Ident("a")))))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ClassDef("Foo6", DefDef("", Nil, List(List(ValDef("a", TypeIdent("Int"), None)), List(ValDef("b", Singleton(Ident("a")), None))), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("a", Inferred(), None), ValDef("b", Inferred(), None)))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ClassDef("Foo6", DefDef("", Nil, List(List(ValDef("a", TypeIdent("Int"), None)), List(ValDef("b", Singleton(Ident("a")), None))), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("a", Inferred(), None), ValDef("b", Inferred(), None)))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ClassDef("Foo7", DefDef("", Nil, List(List(ValDef("a", TypeIdent("Int"), None))), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("a", Inferred(), None), DefDef("", Nil, List(Nil), Inferred(), Some(Block(List(Apply(Select(This(Some(Id("Foo7"))), ""), List(Literal(Constant.Int(6))))), Literal(Constant.Unit()))))))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ClassDef("Foo7", DefDef("", Nil, List(List(ValDef("a", TypeIdent("Int"), None))), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("a", Inferred(), None), DefDef("", Nil, List(Nil), Inferred(), Some(Block(List(Apply(Select(This(Some(Id("Foo7"))), ""), List(Literal(Constant(6))))), Literal(Constant(())))))))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ClassDef("Foo8", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(Apply(Ident("println"), List(Literal(Constant.Int(0))))))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ClassDef("Foo8", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(Apply(Ident("println"), List(Literal(Constant(0))))))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ClassDef("Foo10", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("a", Inferred(), Some(Literal(Constant.Int(9))))))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ClassDef("Foo10", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("a", Inferred(), Some(Literal(Constant(9))))))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ClassDef("Foo11", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("a", Inferred(), Some(Literal(Constant.Int(10)))), DefDef("a_=", Nil, List(List(ValDef("x$1", Inferred(), None))), Inferred(), Some(Literal(Constant.Unit())))))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ClassDef("Foo11", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("a", Inferred(), Some(Literal(Constant(10)))), DefDef("a_=", Nil, List(List(ValDef("x$1", Inferred(), None))), Inferred(), Some(Literal(Constant(()))))))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ClassDef("Foo12", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("a", Inferred(), Some(Literal(Constant.Int(11))))))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ClassDef("Foo12", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("a", Inferred(), Some(Literal(Constant(11))))))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, Nil), ClassDef("Bar", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(TypeIdent("Foo")), ""), Nil)), Nil, None, Nil)), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, Nil), ClassDef("Bar", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(TypeIdent("Foo")), ""), Nil)), Nil, None, Nil)), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ClassDef("Foo2", DefDef("", Nil, List(Nil), Inferred(), None), List(Inferred()), Nil, None, Nil), ClassDef("Bar", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil), TypeIdent("Foo2")), Nil, None, Nil)), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ClassDef("Foo2", DefDef("", Nil, List(Nil), Inferred(), None), List(Inferred()), Nil, None, Nil), ClassDef("Bar", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil), TypeIdent("Foo2")), Nil, None, Nil)), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ClassDef("Foo", DefDef("", Nil, List(List(ValDef("i", TypeIdent("Int"), None))), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("i", Inferred(), None))), ClassDef("Bar", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(TypeIdent("Foo")), ""), List(Literal(Constant.Int(1))))), Nil, None, Nil)), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ClassDef("Foo", DefDef("", Nil, List(List(ValDef("i", TypeIdent("Int"), None))), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("i", Inferred(), None))), ClassDef("Bar", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(TypeIdent("Foo")), ""), List(Literal(Constant(1))))), Nil, None, Nil)), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(TypeDef("X", TypeIdent("Int")))), DefDef("f", Nil, List(List(ValDef("a", TypeIdent("Foo"), None))), TypeSelect(Ident("a"), "X"), Some(Ident("???")))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(TypeDef("X", TypeIdent("Int")))), DefDef("f", Nil, List(List(ValDef("a", TypeIdent("Foo"), None))), TypeSelect(Ident("a"), "X"), Some(Ident("???")))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(TypeDef("X", TypeBoundsTree(Inferred(), Inferred())))), DefDef("f", Nil, List(List(ValDef("a", Refined(TypeIdent("Foo"), List(TypeDef("X", TypeIdent("Int")))), None))), TypeSelect(Ident("a"), "X"), Some(Ident("???")))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ClassDef("Foo", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(TypeDef("X", TypeBoundsTree(Inferred(), Inferred())))), DefDef("f", Nil, List(List(ValDef("a", Refined(TypeIdent("Foo"), List(TypeDef("X", TypeIdent("Int")))), None))), TypeSelect(Ident("a"), "X"), Some(Ident("???")))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) -Inlined(None, Nil, Block(List(ValDef("lambda", Applied(Inferred(), List(TypeIdent("Int"), TypeIdent("Int"))), Some(Block(List(DefDef("$anonfun", Nil, List(List(ValDef("x", Inferred(), None))), Inferred(), Some(Ident("x")))), Lambda(Ident("$anonfun"), None))))), Literal(Constant.Unit()))) +Inlined(None, Nil, Block(List(ValDef("lambda", Applied(Inferred(), List(TypeIdent("Int"), TypeIdent("Int"))), Some(Block(List(DefDef("$anonfun", Nil, List(List(ValDef("x", Inferred(), None))), Inferred(), Some(Ident("x")))), Lambda(Ident("$anonfun"), None))))), Literal(Constant(())))) Type.SymRef(IsClassDefSymbol(), Type.ThisType(Type.SymRef(IsPackageDefSymbol(), NoPrefix()))) diff --git a/tests/run-macros/tasty-indexed-map/quoted_1.scala b/tests/run-macros/tasty-indexed-map/quoted_1.scala index 8d7435d036fb..2c1883baa519 100644 --- a/tests/run-macros/tasty-indexed-map/quoted_1.scala +++ b/tests/run-macros/tasty-indexed-map/quoted_1.scala @@ -29,7 +29,7 @@ object Index { import qctx.tasty._ def name(tp: TypeOrBounds): String = tp match { - case Type.ConstantType(Constant.String(str)) => str + case Type.ConstantType(Constant(str: String)) => str } def names(tp: TypeOrBounds): List[String] = tp match { diff --git a/tests/run-macros/tasty-interpolation-1/Macro.scala b/tests/run-macros/tasty-interpolation-1/Macro.scala index 2967104d2b14..4d01652fc17d 100644 --- a/tests/run-macros/tasty-interpolation-1/Macro.scala +++ b/tests/run-macros/tasty-interpolation-1/Macro.scala @@ -56,7 +56,7 @@ abstract class MacroStringInterpolator[T] { strCtxExpr.unseal.underlyingArgument match { case Select(Typed(Apply(_, List(Apply(_, List(Typed(Repeated(strCtxArgTrees, _), Inferred()))))), _), _) => val strCtxArgs = strCtxArgTrees.map { - case Literal(Constant.String(str)) => str + case Literal(Constant(str: String)) => str case tree => throw new NotStaticlyKnownError("Expected statically known StringContext", tree.seal) } StringContext(strCtxArgs: _*) diff --git a/tests/run-macros/tasty-macro-const/quoted_1.scala b/tests/run-macros/tasty-macro-const/quoted_1.scala index 51fbbd75cf4d..15b41ca0b5f5 100644 --- a/tests/run-macros/tasty-macro-const/quoted_1.scala +++ b/tests/run-macros/tasty-macro-const/quoted_1.scala @@ -8,7 +8,7 @@ object Macros { import qctx.tasty._ val xTree: Term = x.unseal xTree match { - case Inlined(_, _, Literal(Constant.Int(n))) => + case Inlined(_, _, Literal(Constant(n: Int))) => if (n <= 0) QuoteError("Parameter must be natural number") xTree.seal.cast[Int] diff --git a/tests/run-macros/xml-interpolation-1/XmlQuote_1.scala b/tests/run-macros/xml-interpolation-1/XmlQuote_1.scala index 93024be0748a..f1799175eaee 100644 --- a/tests/run-macros/xml-interpolation-1/XmlQuote_1.scala +++ b/tests/run-macros/xml-interpolation-1/XmlQuote_1.scala @@ -50,7 +50,7 @@ object XmlQuote { if isSCOpsConversion(conv) && isStringContextApply(fun) && values.forall(isStringConstant) => - values.collect { case Literal(Constant.String(value)) => value } + values.collect { case Literal(Constant(value: String)) => value } case tree => abort(s"String literal expected, but ${tree.showExtractors} found") } diff --git a/tests/run-macros/xml-interpolation-2/XmlQuote_1.scala b/tests/run-macros/xml-interpolation-2/XmlQuote_1.scala index 8cded8fa6437..f04b4c090fdd 100644 --- a/tests/run-macros/xml-interpolation-2/XmlQuote_1.scala +++ b/tests/run-macros/xml-interpolation-2/XmlQuote_1.scala @@ -42,7 +42,7 @@ object XmlQuote { ctx1 match { case Apply(fun, List(Typed(Repeated(values, _), _))) if isStringContextApply(fun) => values.iterator.map { - case Literal(Constant.String(value)) => value + case Literal(Constant(value: String)) => value case _ => QuoteError("Expected statically known String") }.toList case _ => QuoteError("Expected statically known StringContext") diff --git a/tests/run-with-compiler/tasty-consumer.check b/tests/run-with-compiler/tasty-consumer.check index 04a1ecf43c56..ec72fc7edbfd 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), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("foo", TypeIdent("Int"), Some(Literal(Constant.Int(2)))), DefDef("bar", Nil, List(List(ValDef("i", TypeIdent("Int"), None))), TypeIdent("Int"), Some(Literal(Constant.Int(3)))))) +ClassDef("Foo", DefDef("", Nil, List(Nil), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("foo", TypeIdent("Int"), Some(Literal(Constant(2)))), DefDef("bar", Nil, List(List(ValDef("i", TypeIdent("Int"), None))), TypeIdent("Int"), Some(Literal(Constant(3)))))) DefDef("", Nil, List(Nil), Inferred(), None) -ValDef("foo", TypeIdent("Int"), Some(Literal(Constant.Int(2)))) -DefDef("bar", Nil, List(List(ValDef("i", TypeIdent("Int"), None))), TypeIdent("Int"), Some(Literal(Constant.Int(3)))) +ValDef("foo", TypeIdent("Int"), Some(Literal(Constant(2)))) +DefDef("bar", Nil, List(List(ValDef("i", TypeIdent("Int"), None))), TypeIdent("Int"), Some(Literal(Constant(3)))) ValDef("i", TypeIdent("Int"), None)