diff options
author | Martin Odersky <odersky@gmail.com> | 2006-10-06 14:13:02 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2006-10-06 14:13:02 +0000 |
commit | af995b1f8fa2787022ad3c09cfc8d4d9a46785f0 (patch) | |
tree | 8759b60545c31b3b204d2a5a6aebbf3bf54256e6 | |
parent | 5a4c34e338f5704bfaf60c1849aa55930f706b51 (diff) | |
download | scala-af995b1f8fa2787022ad3c09cfc8d4d9a46785f0.tar.gz scala-af995b1f8fa2787022ad3c09cfc8d4d9a46785f0.tar.bz2 scala-af995b1f8fa2787022ad3c09cfc8d4d9a46785f0.zip |
fixed bug766
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 7 | ||||
-rw-r--r-- | test/files/neg/bug766.check | 4 | ||||
-rw-r--r-- | test/files/neg/bug766.scala | 9 |
3 files changed, 20 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 087f5c485f..0305a6123f 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1868,6 +1868,13 @@ trait Typers requires Analyzer { if (settings.debug.value) System.out.println(""+tpt1+":"+tpt1.symbol+":"+tpt1.symbol.info);//debug errorTree(tree, "wrong number of type arguments for "+tpt1.tpe+", should be "+tparams.length) } + + case TypeTree() => + // we should get here only when something before failed + // and we try again (@see tryTypedApply). In that case we can assign + // whatever type to tree; we just have to survive until a real error message is issued. + tree setType AnyClass.tpe + case _ => throw new Error("unexpected tree: "+tree);//debug } diff --git a/test/files/neg/bug766.check b/test/files/neg/bug766.check new file mode 100644 index 0000000000..5d534cbaa4 --- /dev/null +++ b/test/files/neg/bug766.check @@ -0,0 +1,4 @@ +bug766.scala:5 error: not found: value badIdentifier + val p = badIdentifier + ^ +one error found diff --git a/test/files/neg/bug766.scala b/test/files/neg/bug766.scala new file mode 100644 index 0000000000..9829b23217 --- /dev/null +++ b/test/files/neg/bug766.scala @@ -0,0 +1,9 @@ +object B +{ + def a = { + for (val n <- Nil; val m <- Nil) { + val p = badIdentifier + false + } + } +} |