diff options
author | Paul Phillips <paulp@improving.org> | 2011-02-08 21:26:46 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-02-08 21:26:46 +0000 |
commit | 5b9b417ae019d3d79c63837895b8295be7a44ce1 (patch) | |
tree | fda7f7584964df59a648e2df9396969fb93783b8 /test/files/neg/badtok-3.scala | |
parent | ac17c71b2357cf37386dec9644b5bdbab1e2fa4f (diff) | |
download | scala-5b9b417ae019d3d79c63837895b8295be7a44ce1.tar.gz scala-5b9b417ae019d3d79c63837895b8295be7a44ce1.tar.bz2 scala-5b9b417ae019d3d79c63837895b8295be7a44ce1.zip |
Added compiler crash recovery to the repl.
up it will issue some apologies and then replay the session up
to the crash line with a new compiler. If you combine this with
-Yrich-exceptions then you can induce a crash, see the exact path
through the code which led there, and then continue on your merry way as
if nothing happened.
// say ticket #4188 for example
% scala -Yrich-exceptions
scala> class A {
| object Ding
| class B {
| (null: Any) match { case _: Ding.type => () }
| }
| }
assertion failed: Trying to access the this of another class: tree.symbol = class $read$$iw$$iw$A, ctx.clazz.symbol = class $read$$iw$$iw$A$B compilation unit:<console>
[searching for exception contexts...]
[GenICode.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad]
958:
959: case This(qual) =>
960: assert(tree.symbol == ctx.clazz.symbol || tree.symbol.isModuleClass,
*961: "Trying to access the this of another class: " +
962: "tree.symbol = " + tree.symbol + ", ctx.clazz.symbol = " + ctx.clazz.symbol + " compilation unit:"+unit)
963: if (tree.symbol.isModuleClass && tree.symbol != ctx.clazz.symbol) {
964: if (settings.debug.value)
[GenICode.genLoadQualifier]
1166: tree match {
1167: case Select(qualifier, _) =>
1168: genLoad(qualifier, ctx, toTypeKind(qualifier.tpe))
*1169: case _ =>
1170: abort("Unknown qualifier " + tree)
1171: }
1172:
[...]
Attempting session recovery...
scala>
No review.
Diffstat (limited to 'test/files/neg/badtok-3.scala')
0 files changed, 0 insertions, 0 deletions