|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The bug was that we declared case classes like:
case class CompFailed() extends NegTestState
but we used their companion objects like in:
case _ => CompFailed
Interestingly, this bug was caught by compiling this code with dotty,
instead of `failureStates` getting inferred to be of type `AnyRef`, it
ended up being a union of object types, this allows dotty to realize our
subsequent pattern match on `failureStates` cannot possibly succeed:
-- Error: /home/smarter/opt/dotty/compiler/test/dotty/partest/DPConsoleRunner.scala
353 | case CompFailedButWrongDiff() =>
| ^
| missing parameter type for parameter x$1 of expanded function x$1 =>
| x$1 @unchecked match
| {
| case CompFailedButWrongDiff() =>
| nextTestActionFailing(s"output differs")
| true
| case _ =>
| false
| }, expected = ?
-- Error: /home/smarter/opt/dotty/compiler/test/dotty/partest/DPConsoleRunner.scala
353 | case CompFailedButWrongDiff() =>
| ^^^^^^^^^^^^^^^^^^^^^^^^
|Pattern type CompFailedButWrongDiff is neither a subtype nor a supertype of selector type CompSucceeded | CompFailedButWrongNErr | CompFailed | CompFailedButWrongDiff'where: CompFailedButWrongDiff is a class in method runNegTest
| CompFailedButWrongDiff' is a object in method runNegTest
|