Skip to content

Commit 70c4083

Browse files
Add test case for unapply on zero arity case class
1 parent 2923d32 commit 70c4083

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/run/zero-arity-case-class.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
case class Foo()
2+
3+
object Test {
4+
def main(args: Array[String]): Unit = {
5+
assert(Foo.unapply(Foo()) == true)
6+
7+
// unapply generate by scalac are `_ != null`,
8+
// dotty returns true in all cases
9+
assert(Foo.unapply(null) == true)
10+
}
11+
}

0 commit comments

Comments
 (0)