From 5323e4df2714774603aea4a61ed6374f4e91ec8e Mon Sep 17 00:00:00 2001 From: Tobias Bordenca Date: Wed, 16 Jan 2019 16:30:16 +0100 Subject: [PATCH 1/4] No empty parens for annotations --- library/src/scala/tasty/reflect/Printers.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/src/scala/tasty/reflect/Printers.scala b/library/src/scala/tasty/reflect/Printers.scala index 6486334ef52a..a29147f46921 100644 --- a/library/src/scala/tasty/reflect/Printers.scala +++ b/library/src/scala/tasty/reflect/Printers.scala @@ -1576,7 +1576,10 @@ trait Printers val Annotation(ref, args) = annot this += "@" printTypeTree(ref) - inParens(printTrees(args, ", ")) + if (args.isEmpty) + this + else + inParens(printTrees(args, ", ")) } def printDefAnnotations(definition: Definition): Buffer = { From b11019be44510f3ac01adaf3ef7225a8bee0b9c8 Mon Sep 17 00:00:00 2001 From: Tobias Bordenca Date: Wed, 16 Jan 2019 16:59:24 +0100 Subject: [PATCH 2/4] Covariant-contravariant flag on type args --- .../dotc/tastyreflect/SymbolOpsImpl.scala | 2 + .../src/scala/tasty/reflect/Printers.scala | 42 +++++++++++++------ .../src/scala/tasty/reflect/SymbolOps.scala | 2 + 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/tastyreflect/SymbolOpsImpl.scala b/compiler/src/dotty/tools/dotc/tastyreflect/SymbolOpsImpl.scala index 9f57f543effe..22a224075d24 100644 --- a/compiler/src/dotty/tools/dotc/tastyreflect/SymbolOpsImpl.scala +++ b/compiler/src/dotty/tools/dotc/tastyreflect/SymbolOpsImpl.scala @@ -94,6 +94,8 @@ trait SymbolOpsImpl extends scala.tasty.reflect.SymbolOps with CoreImpl { def TypeSymbolDeco(symbol: TypeSymbol): TypeSymbolAPI = new TypeSymbolAPI { def tree(implicit ctx: Context): TypeDef = FromSymbol.typeDefFromSym(symbol) + + def isTypeParam(implicit ctx: Context): Boolean = symbol.isTypeParam } object ClassSymbol extends ClassSymbolModule { diff --git a/library/src/scala/tasty/reflect/Printers.scala b/library/src/scala/tasty/reflect/Printers.scala index a29147f46921..c629a190b0b2 100644 --- a/library/src/scala/tasty/reflect/Printers.scala +++ b/library/src/scala/tasty/reflect/Printers.scala @@ -590,8 +590,9 @@ trait Printers else if (flags.is(Flags.Abstract)) this += highlightKeyword("abstract class ", color) += highlightTypeDef(name, color) else this += highlightKeyword("class ", color) += highlightTypeDef(name, color) + val typeParams = stats.collect { case IsTypeDef(targ) => targ }.filter(_.symbol.isTypeParam).zip(targs) if (!flags.is(Flags.Object)) { - printTargsDefs(targs) + printTargsDefs(typeParams) val it = argss.iterator while (it.hasNext) printArgsDefs(it.next()) @@ -606,14 +607,19 @@ trait Printers if (parents1.nonEmpty) this += highlightKeyword(" extends ", color) - def printParent(parent: TermOrTypeTree): Unit = parent match { + def printParent(parent: TermOrTypeTree, needEmptyParens: Boolean = false): Unit = parent match { case IsTypeTree(parent) => printTypeTree(parent) case IsTerm(Term.TypeApply(fun, targs)) => printParent(fun) + case IsTerm(Term.Apply(fun@Term.Apply(_,_), args)) => + printParent(fun, true) + if (!args.isEmpty || needEmptyParens) + inParens(printTrees(args, ", ")) case IsTerm(Term.Apply(fun, args)) => printParent(fun) - inParens(printTrees(args, ", ")) + if (!args.isEmpty || needEmptyParens) + inParens(printTrees(args, ", ")) case IsTerm(Term.Select(Term.New(tpt), _)) => printTypeTree(tpt) case IsTerm(parent) => @@ -691,7 +697,7 @@ trait Printers case IsTypeDef(tdef @ TypeDef(name, rhs)) => printDefAnnotations(tdef) this += highlightKeyword("type ", color) - printTargDef(tdef, isMember = true) + printTargDef((tdef, tdef), isMember = true) case IsValDef(vdef @ ValDef(name, tpt, rhs)) => printDefAnnotations(vdef) @@ -754,7 +760,7 @@ trait Printers printProtectedOrPrivate(ddef) this += highlightKeyword("def ", color) += highlightValDef((if (isConstructor) "this" else name), color) - printTargsDefs(targs) + printTargsDefs(targs.zip(targs)) val it = argss.iterator while (it.hasNext) printArgsDefs(it.next()) @@ -1125,13 +1131,13 @@ trait Printers this } - def printTargsDefs(targs: List[TypeDef]): Unit = { + def printTargsDefs(targs: List[(TypeDef, TypeDef)], isDef:Boolean = true): Unit = { if (!targs.isEmpty) { - def printSeparated(list: List[TypeDef]): Unit = list match { + def printSeparated(list: List[(TypeDef, TypeDef)]): Unit = list match { case Nil => - case x :: Nil => printTargDef(x) + case x :: Nil => printTargDef(x, isDef = isDef) case x :: xs => - printTargDef(x) + printTargDef(x, isDef = isDef) this += ", " printSeparated(xs) } @@ -1140,9 +1146,19 @@ trait Printers } } - def printTargDef(arg: TypeDef, isMember: Boolean = false): Buffer = { - this += arg.name - arg.rhs match { + def printTargDef(arg: (TypeDef, TypeDef), isMember: Boolean = false, isDef:Boolean = true): Buffer = { + val (argDef, argCons) = arg + + if (isDef) { + if (argDef.symbol.flags.is(Flags.Covariant)) { + this += highlightValDef("+", color) + } else if (argDef.symbol.flags.is(Flags.Contravariant)) { + this += highlightValDef("-", color) + } + } + + this += argCons.name + argCons.rhs match { case IsTypeBoundsTree(rhs) => printBoundsTree(rhs) case rhs @ WildcardTypeTree() => printTypeOrBound(rhs.tpe) @@ -1412,7 +1428,7 @@ trait Printers printTypeTree(result) case TypeTree.LambdaTypeTree(tparams, body) => - printTargsDefs(tparams) + printTargsDefs(tparams.zip(tparams), isDef = false) this += highlightTypeDef(" => ", color) printTypeOrBoundsTree(body) diff --git a/library/src/scala/tasty/reflect/SymbolOps.scala b/library/src/scala/tasty/reflect/SymbolOps.scala index e1915c9da180..1988408613b9 100644 --- a/library/src/scala/tasty/reflect/SymbolOps.scala +++ b/library/src/scala/tasty/reflect/SymbolOps.scala @@ -123,6 +123,8 @@ trait SymbolOps extends Core { trait TypeSymbolAPI { /** TypeDef tree of this defintion. */ def tree(implicit ctx: Context): TypeDef + + def isTypeParam(implicit ctx: Context): Boolean } implicit def TypeSymbolDeco(symbol: TypeSymbol): TypeSymbolAPI From b8184cf5703904f0311aba699348aef6c3ebf8f1 Mon Sep 17 00:00:00 2001 From: Tobias Bordenca Date: Wed, 16 Jan 2019 17:16:08 +0100 Subject: [PATCH 3/4] Update expected outputs --- tests/pos/i2104b.decompiled | 16 ++++++++-------- tests/pos/i4678.decompiled | 12 ++++++------ tests/pos/simpleAnnot.decompiled | 14 +++++++------- tests/pos/simpleCaseClass-1.decompiled | 8 ++++---- tests/pos/simpleCaseClass-2.decompiled | 8 ++++---- tests/pos/simpleCaseClass-3.decompiled | 8 ++++---- tests/pos/simpleCaseObject.decompiled | 6 +++--- tests/pos/simpleClass-2.decompiled | 6 +++--- tests/pos/simpleClass.decompiled | 6 +++--- tests/pos/simpleSuper.decompiled | 10 +++++----- tests/pos/t116.decompiled | 6 +++--- tests/pos/t6225b.decompiled | 8 ++++---- 12 files changed, 54 insertions(+), 54 deletions(-) diff --git a/tests/pos/i2104b.decompiled b/tests/pos/i2104b.decompiled index 9d240a3391a3..009a3c87f929 100644 --- a/tests/pos/i2104b.decompiled +++ b/tests/pos/i2104b.decompiled @@ -1,10 +1,10 @@ -/** Decompiled from out/posTestFromTasty/pos/i2104b/Cons.class */ -trait Cons[H, T]() extends java.lang.Object +/** Decompiled from out/posTestFromTasty/pos/i2104b/Cons.tasty */ +trait Cons[+H, +T]() extends java.lang.Object object Cons { def apply[H, T](h: H, t: T): Cons[H, T] = scala.Predef.??? def unapply[H, T](t: Cons[H, T]): scala.Option[Pair[H, T]] = scala.Predef.??? } -/** Decompiled from out/posTestFromTasty/pos/i2104b/Pair.class */ +/** Decompiled from out/posTestFromTasty/pos/i2104b/Pair.tasty */ case class Pair[A, B](_1: A, _2: B) { override def hashCode(): scala.Int = { var acc: scala.Int = 2479866 @@ -13,13 +13,13 @@ case class Pair[A, B](_1: A, _2: B) { scala.runtime.Statics.finalizeHash(acc, 2) } override def equals(x$0: scala.Any): scala.Boolean = Pair.this.eq(x$0.asInstanceOf[java.lang.Object]).||(x$0 match { - case x$0: Pair[A, B] @scala.unchecked() => + case x$0: Pair[A, B] @scala.unchecked => Pair.this._1.==(x$0._1).&&(Pair.this._2.==(x$0._2)) case _ => false }) override def toString(): java.lang.String = scala.runtime.ScalaRunTime._toString(Pair.this) - override def canEqual(that: scala.Any): scala.Boolean = that.isInstanceOf[Pair[A, B] @scala.unchecked()] + override def canEqual(that: scala.Any): scala.Boolean = that.isInstanceOf[Pair[A, B] @scala.unchecked] override def productArity: scala.Int = 2 override def productPrefix: java.lang.String = "Pair" override def productElement(n: scala.Int): scala.Any = n match { @@ -31,11 +31,11 @@ case class Pair[A, B](_1: A, _2: B) { throw new java.lang.IndexOutOfBoundsException(n.toString()) } } -object Pair extends scala.AnyRef() -/** Decompiled from out/posTestFromTasty/pos/i2104b/Test.class */ +object Pair extends scala.AnyRef +/** Decompiled from out/posTestFromTasty/pos/i2104b/Test.tasty */ object Test { def main(args: scala.Array[scala.Predef.String]): scala.Unit = Cons.apply[scala.Option[scala.Int], scala.None.type](scala.Option.apply[scala.Int](1), scala.None) match { case Cons(scala.Some(i), scala.None) => () } -} +} \ No newline at end of file diff --git a/tests/pos/i4678.decompiled b/tests/pos/i4678.decompiled index 3d85df1ff562..99b2e0faa7f1 100644 --- a/tests/pos/i4678.decompiled +++ b/tests/pos/i4678.decompiled @@ -1,14 +1,14 @@ /** Decompiled from out/posTestFromTasty/pos/i4678/Foo.tasty */ class Foo() { - val x: scala.Int = (1: @annot1() @annot2() @annot3() @annot4() @annot5()) + val x: scala.Int = (1: @annot1 @annot2 @annot3 @annot4 @annot5) } /** Decompiled from out/posTestFromTasty/pos/i4678/annot1.tasty */ -class annot1() extends scala.annotation.Annotation() +class annot1() extends scala.annotation.Annotation /** Decompiled from out/posTestFromTasty/pos/i4678/annot2.tasty */ -class annot2() extends scala.annotation.Annotation() +class annot2() extends scala.annotation.Annotation /** Decompiled from out/posTestFromTasty/pos/i4678/annot3.tasty */ -class annot3() extends scala.annotation.Annotation() +class annot3() extends scala.annotation.Annotation /** Decompiled from out/posTestFromTasty/pos/i4678/annot4.tasty */ -class annot4() extends scala.annotation.Annotation() +class annot4() extends scala.annotation.Annotation /** Decompiled from out/posTestFromTasty/pos/i4678/annot5.tasty */ -class annot5() extends scala.annotation.Annotation() \ No newline at end of file +class annot5() extends scala.annotation.Annotation \ No newline at end of file diff --git a/tests/pos/simpleAnnot.decompiled b/tests/pos/simpleAnnot.decompiled index f90c1f0ba5cf..e540d3fd03f0 100644 --- a/tests/pos/simpleAnnot.decompiled +++ b/tests/pos/simpleAnnot.decompiled @@ -1,9 +1,9 @@ -/** Decompiled from out/posTestFromTasty/pos/simpleAnnot/Foo.class */ +/** Decompiled from out/posTestFromTasty/pos/simpleAnnot/Foo.tasty */ class Foo() { - @annot() type A = scala.Int - @annot() val a: scala.Int = scala.Predef.??? - val b: scala.Int @annot() = scala.Predef.??? - def c(x: scala.Int): scala.Int = (x: @annot()) + @annot type A = scala.Int + @annot val a: scala.Int = scala.Predef.??? + val b: scala.Int @annot = scala.Predef.??? + def c(x: scala.Int): scala.Int = (x: @annot) } -/** Decompiled from out/posTestFromTasty/pos/simpleAnnot/annot.class */ -class annot() extends scala.annotation.Annotation() +/** Decompiled from out/posTestFromTasty/pos/simpleAnnot/annot.tasty */ +class annot() extends scala.annotation.Annotation \ No newline at end of file diff --git a/tests/pos/simpleCaseClass-1.decompiled b/tests/pos/simpleCaseClass-1.decompiled index deed4f778eb3..94b9afd1225d 100644 --- a/tests/pos/simpleCaseClass-1.decompiled +++ b/tests/pos/simpleCaseClass-1.decompiled @@ -1,14 +1,14 @@ -/** Decompiled from out/posTestFromTasty/pos/simpleCaseClass-1/A.class */ +/** Decompiled from out/posTestFromTasty/pos/simpleCaseClass-1/A.tasty */ case class A() { override def hashCode(): scala.Int = 1914112431 override def equals(x$0: scala.Any): scala.Boolean = A.this.eq(x$0.asInstanceOf[java.lang.Object]).||(x$0 match { - case x$0: A @scala.unchecked() => + case x$0: A @scala.unchecked => true case _ => false }) override def toString(): java.lang.String = scala.runtime.ScalaRunTime._toString(A.this) - override def canEqual(that: scala.Any): scala.Boolean = that.isInstanceOf[A @scala.unchecked()] + override def canEqual(that: scala.Any): scala.Boolean = that.isInstanceOf[A @scala.unchecked] override def productArity: scala.Int = 0 override def productPrefix: java.lang.String = "A" override def productElement(n: scala.Int): scala.Any = n match { @@ -16,4 +16,4 @@ case class A() { throw new java.lang.IndexOutOfBoundsException(n.toString()) } } -object A extends scala.Function0[A] +object A extends scala.Function0[A] \ No newline at end of file diff --git a/tests/pos/simpleCaseClass-2.decompiled b/tests/pos/simpleCaseClass-2.decompiled index 4156a6447b10..9e0c75a8542e 100644 --- a/tests/pos/simpleCaseClass-2.decompiled +++ b/tests/pos/simpleCaseClass-2.decompiled @@ -1,4 +1,4 @@ -/** Decompiled from out/posTestFromTasty/pos/simpleCaseClass-2/A.class */ +/** Decompiled from out/posTestFromTasty/pos/simpleCaseClass-2/A.tasty */ case class A(x: scala.Int) { override def hashCode(): scala.Int = { var acc: scala.Int = 65 @@ -6,13 +6,13 @@ case class A(x: scala.Int) { scala.runtime.Statics.finalizeHash(acc, 1) } override def equals(x$0: scala.Any): scala.Boolean = A.this.eq(x$0.asInstanceOf[java.lang.Object]).||(x$0 match { - case x$0: A @scala.unchecked() => + case x$0: A @scala.unchecked => A.this.x.==(x$0.x) case _ => false }) override def toString(): java.lang.String = scala.runtime.ScalaRunTime._toString(A.this) - override def canEqual(that: scala.Any): scala.Boolean = that.isInstanceOf[A @scala.unchecked()] + override def canEqual(that: scala.Any): scala.Boolean = that.isInstanceOf[A @scala.unchecked] override def productArity: scala.Int = 1 override def productPrefix: java.lang.String = "A" override def productElement(n: scala.Int): scala.Any = n match { @@ -22,4 +22,4 @@ case class A(x: scala.Int) { throw new java.lang.IndexOutOfBoundsException(n.toString()) } } -object A extends scala.Function1[scala.Int, A] +object A extends scala.Function1[scala.Int, A] \ No newline at end of file diff --git a/tests/pos/simpleCaseClass-3.decompiled b/tests/pos/simpleCaseClass-3.decompiled index 6dcd9d72ab22..6ece597b3836 100644 --- a/tests/pos/simpleCaseClass-3.decompiled +++ b/tests/pos/simpleCaseClass-3.decompiled @@ -1,4 +1,4 @@ -/** Decompiled from out/posTestFromTasty/pos/simpleCaseClass-3/A.class */ +/** Decompiled from out/posTestFromTasty/pos/simpleCaseClass-3/A.tasty */ case class A[T](x: T) { override def hashCode(): scala.Int = { var acc: scala.Int = 65 @@ -6,13 +6,13 @@ case class A[T](x: T) { scala.runtime.Statics.finalizeHash(acc, 1) } override def equals(x$0: scala.Any): scala.Boolean = A.this.eq(x$0.asInstanceOf[java.lang.Object]).||(x$0 match { - case x$0: A[T] @scala.unchecked() => + case x$0: A[T] @scala.unchecked => A.this.x.==(x$0.x) case _ => false }) override def toString(): java.lang.String = scala.runtime.ScalaRunTime._toString(A.this) - override def canEqual(that: scala.Any): scala.Boolean = that.isInstanceOf[A[T] @scala.unchecked()] + override def canEqual(that: scala.Any): scala.Boolean = that.isInstanceOf[A[T] @scala.unchecked] override def productArity: scala.Int = 1 override def productPrefix: java.lang.String = "A" override def productElement(n: scala.Int): scala.Any = n match { @@ -22,4 +22,4 @@ case class A[T](x: T) { throw new java.lang.IndexOutOfBoundsException(n.toString()) } } -object A extends scala.AnyRef() \ No newline at end of file +object A extends scala.AnyRef \ No newline at end of file diff --git a/tests/pos/simpleCaseObject.decompiled b/tests/pos/simpleCaseObject.decompiled index 6b48915993df..22dd52baaa65 100644 --- a/tests/pos/simpleCaseObject.decompiled +++ b/tests/pos/simpleCaseObject.decompiled @@ -1,9 +1,9 @@ -/** Decompiled from out/posTestFromTasty/pos/simpleCaseObject/foo/Foo.class */ +/** Decompiled from out/posTestFromTasty/pos/simpleCaseObject/foo/Foo.tasty */ package foo { case object Foo { override def hashCode(): scala.Int = 1045991777 override def toString(): java.lang.String = "Foo" - override def canEqual(that: scala.Any): scala.Boolean = that.isInstanceOf[foo.Foo.type @scala.unchecked()] + override def canEqual(that: scala.Any): scala.Boolean = that.isInstanceOf[foo.Foo.type @scala.unchecked] override def productArity: scala.Int = 0 override def productPrefix: java.lang.String = "Foo" override def productElement(n: scala.Int): scala.Any = n match { @@ -11,4 +11,4 @@ package foo { throw new java.lang.IndexOutOfBoundsException(n.toString()) } } -} +} \ No newline at end of file diff --git a/tests/pos/simpleClass-2.decompiled b/tests/pos/simpleClass-2.decompiled index 65b0fec93ceb..b4fe479d7478 100644 --- a/tests/pos/simpleClass-2.decompiled +++ b/tests/pos/simpleClass-2.decompiled @@ -1,8 +1,8 @@ -/** Decompiled from out/posTestFromTasty/pos/simpleClass-2/foo/A.class */ +/** Decompiled from out/posTestFromTasty/pos/simpleClass-2/foo/A.tasty */ package foo { - class A() extends foo.B() + class A() extends foo.B } -/** Decompiled from out/posTestFromTasty/pos/simpleClass-2/foo/B.class */ +/** Decompiled from out/posTestFromTasty/pos/simpleClass-2/foo/B.tasty */ package foo { class B() } \ No newline at end of file diff --git a/tests/pos/simpleClass.decompiled b/tests/pos/simpleClass.decompiled index d76eff50e07b..1480d1e37a19 100644 --- a/tests/pos/simpleClass.decompiled +++ b/tests/pos/simpleClass.decompiled @@ -1,8 +1,8 @@ -/** Decompiled from out/posTestFromTasty/pos/simpleClass/foo/A.class */ +/** Decompiled from out/posTestFromTasty/pos/simpleClass/foo/A.tasty */ package foo { class A() } -/** Decompiled from out/posTestFromTasty/pos/simpleClass/foo/B.class */ +/** Decompiled from out/posTestFromTasty/pos/simpleClass/foo/B.tasty */ package foo { - class B() extends foo.A() + class B() extends foo.A } \ No newline at end of file diff --git a/tests/pos/simpleSuper.decompiled b/tests/pos/simpleSuper.decompiled index 987cc5e7a089..2ccda001213d 100644 --- a/tests/pos/simpleSuper.decompiled +++ b/tests/pos/simpleSuper.decompiled @@ -1,18 +1,18 @@ -/** Decompiled from out/posTestFromTasty/pos/simpleSuper/foo/A.class */ +/** Decompiled from out/posTestFromTasty/pos/simpleSuper/foo/A.tasty */ package foo { class A() { def foo: scala.Int = 1 } } -/** Decompiled from out/posTestFromTasty/pos/simpleSuper/foo/B.class */ +/** Decompiled from out/posTestFromTasty/pos/simpleSuper/foo/B.tasty */ package foo { trait B() extends java.lang.Object { def foo: scala.Int = 2 } } -/** Decompiled from out/posTestFromTasty/pos/simpleSuper/foo/C.class */ +/** Decompiled from out/posTestFromTasty/pos/simpleSuper/foo/C.tasty */ package foo { - class C() extends foo.A() with foo.B { + class C() extends foo.A with foo.B { override def foo: scala.Int = super.foo.+(super[B].foo) } -} +} \ No newline at end of file diff --git a/tests/pos/t116.decompiled b/tests/pos/t116.decompiled index 269193c97eb2..339cb645155f 100644 --- a/tests/pos/t116.decompiled +++ b/tests/pos/t116.decompiled @@ -1,8 +1,8 @@ -/** Decompiled from out/posTestFromTasty/pos/t116/C.class */ +/** Decompiled from out/posTestFromTasty/pos/t116/C.tasty */ class C() { def this(x: scala.Int) = { this() - class D() extends C() + class D() extends C () } -} +} \ No newline at end of file diff --git a/tests/pos/t6225b.decompiled b/tests/pos/t6225b.decompiled index d8872fd2721e..d1abda2b16f0 100644 --- a/tests/pos/t6225b.decompiled +++ b/tests/pos/t6225b.decompiled @@ -1,10 +1,10 @@ -/** Decompiled from out/posTestFromTasty/pos/t6225b/library/x/X.class */ +/** Decompiled from out/posTestFromTasty/pos/t6225b/library/x/X.tasty */ package library.x { class X() { class Foo() } } -/** Decompiled from out/posTestFromTasty/pos/t6225b/library/y/package.class */ +/** Decompiled from out/posTestFromTasty/pos/t6225b/library/y/package.tasty */ package library { - package object y extends library.x.X() -} + package object y extends library.x.X +} \ No newline at end of file From fdf8139be91ab334f6214f9f471b023c7191e609 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Tue, 29 Jan 2019 11:20:29 +0100 Subject: [PATCH 4/4] Fix after rebase --- tests/run/literals.decompiled | 6 +++--- tests/run/simpleClass.decompiled | 8 ++++---- tests/run/t4300.decompiled | 8 ++++---- tests/run/t889.decompiled | 4 ++-- tests/run/valueclasses-pavlov.decompiled | 22 +++++++++++----------- tests/run/virtpatmat_alts.decompiled | 4 ++-- 6 files changed, 26 insertions(+), 26 deletions(-) diff --git a/tests/run/literals.decompiled b/tests/run/literals.decompiled index 0515ab0223c7..67279692e269 100644 --- a/tests/run/literals.decompiled +++ b/tests/run/literals.decompiled @@ -1,4 +1,4 @@ -/** Decompiled from out/runTestFromTasty/run/literals/Test.class */ +/** Decompiled from out/runTestFromTasty/run/literals/Test.tasty */ object Test { def αρετη: java.lang.String = "alpha rho epsilon tau eta" case class GGG(i: scala.Int) { @@ -9,13 +9,13 @@ object Test { scala.runtime.Statics.finalizeHash(acc, 1) } override def equals(x$0: scala.Any): scala.Boolean = GGG.this.eq(x$0.asInstanceOf[java.lang.Object]).||(x$0 match { - case x$0: Test.GGG @scala.unchecked() => + case x$0: Test.GGG @scala.unchecked => GGG.this.i.==(x$0.i) case _ => false }) override def toString(): java.lang.String = scala.runtime.ScalaRunTime._toString(GGG.this) - override def canEqual(that: scala.Any): scala.Boolean = that.isInstanceOf[Test.GGG @scala.unchecked()] + override def canEqual(that: scala.Any): scala.Boolean = that.isInstanceOf[Test.GGG @scala.unchecked] override def productArity: scala.Int = 1 override def productPrefix: java.lang.String = "GGG" override def productElement(n: scala.Int): scala.Any = n match { diff --git a/tests/run/simpleClass.decompiled b/tests/run/simpleClass.decompiled index 7f818d5f40e0..2e60f888ffb7 100644 --- a/tests/run/simpleClass.decompiled +++ b/tests/run/simpleClass.decompiled @@ -1,15 +1,15 @@ -/** Decompiled from out/runTestFromTasty/run/simpleClass/Test.class */ +/** Decompiled from out/runTestFromTasty/run/simpleClass/Test.tasty */ object Test { def main(args: scala.Array[scala.Predef.String]): scala.Unit = { scala.Predef.println(new foo.A().getClass().getName()) scala.Predef.println(new foo.B().getClass().getName()) } } -/** Decompiled from out/runTestFromTasty/run/simpleClass/foo/A.class */ +/** Decompiled from out/runTestFromTasty/run/simpleClass/foo/A.tasty */ package foo { class A() } -/** Decompiled from out/runTestFromTasty/run/simpleClass/foo/B.class */ +/** Decompiled from out/runTestFromTasty/run/simpleClass/foo/B.tasty */ package foo { - class B() extends foo.A() + class B() extends foo.A } \ No newline at end of file diff --git a/tests/run/t4300.decompiled b/tests/run/t4300.decompiled index c13f2441823e..473386df7e61 100644 --- a/tests/run/t4300.decompiled +++ b/tests/run/t4300.decompiled @@ -1,8 +1,8 @@ -/** Decompiled from out/runTestFromTasty/run/t4300/A.class */ +/** Decompiled from out/runTestFromTasty/run/t4300/A.tasty */ trait A() extends java.lang.Object { def f(): scala.Unit = scala.Predef.println("A") } -/** Decompiled from out/runTestFromTasty/run/t4300/B.class */ +/** Decompiled from out/runTestFromTasty/run/t4300/B.tasty */ class B() extends A { def b(): scala.Unit = super[A].f() trait C() extends java.lang.Object { @@ -12,14 +12,14 @@ class B() extends A { def h(): scala.Unit = scala.Predef.intWrapper(0).until(1).foreach[scala.Unit](((i: scala.Int) => B.super[A].f())) override def f(): scala.Unit = scala.Predef.println("B") } -/** Decompiled from out/runTestFromTasty/run/t4300/Test.class */ +/** Decompiled from out/runTestFromTasty/run/t4300/Test.tasty */ object Test { def main(args: scala.Array[scala.Predef.String]): scala.Unit = { val b: B = new B() b.b() { - final class $anon() extends b.C() + final class $anon() extends b.C (new $anon(): b.C) }.c() b.g() diff --git a/tests/run/t889.decompiled b/tests/run/t889.decompiled index 55d380e23759..312c4195b932 100644 --- a/tests/run/t889.decompiled +++ b/tests/run/t889.decompiled @@ -1,5 +1,5 @@ -/** Decompiled from out/runTestFromTasty/run/t889/Test.class */ -object Test extends dotty.runtime.LegacyApp() { +/** Decompiled from out/runTestFromTasty/run/t889/Test.tasty */ +object Test extends dotty.runtime.LegacyApp { val a: collection.immutable.List[java.lang.String] = scala.List.apply[java.lang.String]("a") Test.a match { case scala.Seq("a", "b", rest: _*) => diff --git a/tests/run/valueclasses-pavlov.decompiled b/tests/run/valueclasses-pavlov.decompiled index 593489526077..14579d1773fb 100644 --- a/tests/run/valueclasses-pavlov.decompiled +++ b/tests/run/valueclasses-pavlov.decompiled @@ -1,40 +1,40 @@ -/** Decompiled from out/runTestFromTasty/run/valueclasses-pavlov/Box1.class */ -final class Box1(val value: scala.Predef.String) extends scala.AnyVal() { +/** Decompiled from out/runTestFromTasty/run/valueclasses-pavlov/Box1.tasty */ +final class Box1(val value: scala.Predef.String) extends scala.AnyVal { override def hashCode(): scala.Int = Box1.this.value.hashCode() override def equals(x$0: scala.Any): scala.Boolean = x$0 match { - case x$0: Box1 @scala.unchecked() => + case x$0: Box1 @scala.unchecked => Box1.this.value.==(x$0.value) case _ => false } } -object Box1 extends scala.AnyRef() -/** Decompiled from out/runTestFromTasty/run/valueclasses-pavlov/Box2.class */ -final class Box2(val value: scala.Predef.String) extends scala.AnyVal() with Foo { +object Box1 extends scala.AnyRef +/** Decompiled from out/runTestFromTasty/run/valueclasses-pavlov/Box2.tasty */ +final class Box2(val value: scala.Predef.String) extends scala.AnyVal with Foo { def box1(x: Box1): scala.Predef.String = "box1: ok" def box2(x: Box2): scala.Predef.String = "box2: ok" override def hashCode(): scala.Int = Box2.this.value.hashCode() override def equals(x$0: scala.Any): scala.Boolean = x$0 match { - case x$0: Box2 @scala.unchecked() => + case x$0: Box2 @scala.unchecked => Box2.this.value.==(x$0.value) case _ => false } } -object Box2 extends scala.AnyRef() -/** Decompiled from out/runTestFromTasty/run/valueclasses-pavlov/C.class */ +object Box2 extends scala.AnyRef +/** Decompiled from out/runTestFromTasty/run/valueclasses-pavlov/C.tasty */ class C(x: scala.Predef.String) { def this() = { this("") () } } -/** Decompiled from out/runTestFromTasty/run/valueclasses-pavlov/Foo.class */ +/** Decompiled from out/runTestFromTasty/run/valueclasses-pavlov/Foo.tasty */ trait Foo() extends scala.Any { def box1(x: Box1): scala.Predef.String def box2(x: Box2): scala.Predef.String } -/** Decompiled from out/runTestFromTasty/run/valueclasses-pavlov/Test.class */ +/** Decompiled from out/runTestFromTasty/run/valueclasses-pavlov/Test.tasty */ object Test { def main(args: scala.Array[scala.Predef.String]): scala.Unit = { val b1: Box1 = new Box1("") diff --git a/tests/run/virtpatmat_alts.decompiled b/tests/run/virtpatmat_alts.decompiled index 2e60b123fb46..97502e290fc9 100644 --- a/tests/run/virtpatmat_alts.decompiled +++ b/tests/run/virtpatmat_alts.decompiled @@ -1,5 +1,5 @@ -/** Decompiled from out/runTestFromTasty/run/virtpatmat_alts/Test.class */ -object Test extends dotty.runtime.LegacyApp() { +/** Decompiled from out/runTestFromTasty/run/virtpatmat_alts/Test.tasty */ +object Test extends dotty.runtime.LegacyApp { scala.Tuple2.apply[scala.Boolean, scala.Boolean](true, true) match { case (scala.Tuple2(true, true) | scala.Tuple2(false, false)) => 1