Skip to content

Commit 03403b4

Browse files
committed
wip
1 parent 0d34aa4 commit 03403b4

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

library/src/scala/tasty/util/ShowSourceCode.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
535535
body match {
536536
case Term.Block(stats, expr) =>
537537
printTrees(stats, lineBreak())
538+
this += lineBreak()
538539
printTree(expr)
539540
case body =>
540541
printTree(body)

tests/pos/i2104.decompiled

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ class Cons[H, T]() extends java.lang.Object
33
object Cons {
44
def apply[H, T](h: H, t: T): Cons[H, T] = scala.Predef.???
55
def unapply[H, T](t: Cons[H, T]): scala.Option[Pair[H, T]] = scala.Predef.???
6-
}/** Decompiled from out/posTestFromTasty/pos/i2104/Pair.class */
6+
}
7+
/** Decompiled from out/posTestFromTasty/pos/i2104/Pair.class */
78
case class Pair[A, B](_1: A, _2: B) {
8-
def copy[A >: scala.Nothing <: scala.Any, B >: scala.Nothing <: scala.Any](_1: A, _2: B): Pair[A, B] = new Pair[A, B](_1, _2)
9-
def copy$default$1[A >: scala.Nothing <: scala.Any, B >: scala.Nothing <: scala.Any]: A = (_1: _1)
10-
def copy$default$2[A >: scala.Nothing <: scala.Any, B >: scala.Nothing <: scala.Any]: B = (_2: _2)
119
override def hashCode(): scala.Int = {
1210
var acc: scala.Int = 2479866
1311
acc = scala.runtime.Statics.mix(acc, scala.runtime.Statics.anyHash(_1))
@@ -33,18 +31,13 @@ case class Pair[A, B](_1: A, _2: B) {
3331
throw new java.lang.IndexOutOfBoundsException(n.toString())
3432
}
3533
}
36-
object Pair extends scala.AnyRef {
37-
def apply[A >: scala.Nothing <: scala.Any, B >: scala.Nothing <: scala.Any](_1: A, _2: B): Pair[A, B] = new Pair[A, B](_1, _2)
38-
def unapply[A >: scala.Nothing <: scala.Any, B >: scala.Nothing <: scala.Any](x$1: Pair[A, B]): Pair[A, B] = x$1
39-
}/** Decompiled from out/posTestFromTasty/pos/i2104/Test.class */
34+
object Pair extends scala.AnyRef
35+
/** Decompiled from out/posTestFromTasty/pos/i2104/Test.class */
4036
object Test {
41-
def main(args: scala.Array[scala.Predef.String]): scala.Unit = {
4237
Cons.apply[scala.Option[scala.Int], scala.None.type](scala.Option.apply[scala.Int](1), scala.None) match {
43-
case Cons(_: scala.Some[scala.Int], scala.None) =>
44-
{
45-
(i: scala.Int)
46-
dotty.DottyPredef.assert(i.==(1))
47-
}
38+
case Cons(Some(i), scala.None) =>
39+
(i: scala.Int)
40+
dotty.DottyPredef.assert(i.==(1))
4841
}
4942
}
50-
}
43+
}

0 commit comments

Comments
 (0)