Skip to content

Commit 420e4c5

Browse files
committed
Make custom version of the test
In dotty bootstapped the assert is inlined
1 parent dbd7777 commit 420e4c5

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

tests/pos/i2104.decompiled renamed to tests/pos/i2104b.decompiled

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/** Decompiled from out/posTestFromTasty/pos/i2104/Cons.class */
1+
/** Decompiled from out/posTestFromTasty/pos/i2104b/Cons.class */
22
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.???
66
}
7-
/** Decompiled from out/posTestFromTasty/pos/i2104/Pair.class */
7+
/** Decompiled from out/posTestFromTasty/pos/i2104b/Pair.class */
88
case class Pair[A, B](_1: A, _2: B) {
99
override def hashCode(): scala.Int = {
1010
var acc: scala.Int = 2479866
@@ -32,13 +32,12 @@ case class Pair[A, B](_1: A, _2: B) {
3232
}
3333
}
3434
object Pair extends scala.AnyRef
35-
/** Decompiled from out/posTestFromTasty/pos/i2104/Test.class */
35+
/** Decompiled from out/posTestFromTasty/pos/i2104b/Test.class */
3636
object Test {
3737
def main(args: scala.Array[scala.Predef.String]): scala.Unit = {
3838
Cons.apply[scala.Option[scala.Int], scala.None.type](scala.Option.apply[scala.Int](1), scala.None) match {
3939
case Cons(scala.Some(i), scala.None) =>
40-
(i: scala.Int)
41-
dotty.DottyPredef.assert(i.==(1))
40+
()
4241
}
4342
}
4443
}

tests/pos/i2104b.scala

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
case class Pair[A, B](_1: A, _2: B)
2+
3+
trait Cons[+H, +T]
4+
5+
object Cons {
6+
def apply[H, T](h: H, t: T): Cons[H, T] = ???
7+
def unapply[H, T](t: Cons[H, T]): Option[Pair[H, T]] = ???
8+
}
9+
10+
object Test {
11+
def main(args: Array[String]): Unit = {
12+
Cons(Option(1), None) match {
13+
case Cons(Some(i), None) =>
14+
}
15+
}
16+
}

0 commit comments

Comments
 (0)