diff options
author | Martin Odersky <odersky@gmail.com> | 2012-07-05 12:16:46 +0200 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-07-11 17:39:58 +0200 |
commit | f08378f766280dc4ad5ff2fadd28f6dcdab057b6 (patch) | |
tree | 41d037f7699201e9f944bdb3435535fb2541eee3 | |
parent | bad93927836f302be3b973335a63bb5e69b2237c (diff) | |
download | scala-f08378f766280dc4ad5ff2fadd28f6dcdab057b6.tar.gz scala-f08378f766280dc4ad5ff2fadd28f6dcdab057b6.tar.bz2 scala-f08378f766280dc4ad5ff2fadd28f6dcdab057b6.zip |
don't crash on syntactically incorrect value classes
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index b9fe269e43..5241974793 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1379,7 +1379,7 @@ trait Typers extends Modes with Adaptations with Tags { for (stat <- body) if (!treeInfo.isAllowedInUniversalTrait(stat) && !isUnderlyingAcc(stat.symbol)) unit.error(stat.pos, - if (stat.symbol hasFlag PARAMACCESSOR) "illegal parameter for value class" + if (stat.symbol != null && (stat.symbol hasFlag PARAMACCESSOR)) "illegal parameter for value class" else "this statement is not allowed in value class: " + stat) case x => unit.error(clazz.pos, "value class needs to have exactly one public val parameter") |