diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2016-11-27 17:19:57 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2017-01-28 19:12:19 +0100 |
commit | 779c96bef04d81048f91135b386bd7f37fcf1f20 (patch) | |
tree | f2fe3165a4ffc99c863edca6f4470f05707c22a8 /compiler/src/dotty/tools | |
parent | cb2c2a0ff1631df91f84a85b0db814b24a4d6d62 (diff) | |
download | dotty-779c96bef04d81048f91135b386bd7f37fcf1f20.tar.gz dotty-779c96bef04d81048f91135b386bd7f37fcf1f20.tar.bz2 dotty-779c96bef04d81048f91135b386bd7f37fcf1f20.zip |
Fix bug in partest.DPConsoleRunner
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
Diffstat (limited to 'compiler/src/dotty/tools')
0 files changed, 0 insertions, 0 deletions