summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2009-07-05 07:19:02 +0000
committerLukas Rytz <lukas.rytz@epfl.ch>2009-07-05 07:19:02 +0000
commit3ba0e87fed08f64066bf3412580fcdf635762f31 (patch)
tree123dfca72e28a1e0388d2a0c39808f3b8c29e329 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent3be21076e049cb966397f3026c7dbb6b96ad57a8 (diff)
downloadscala-3ba0e87fed08f64066bf3412580fcdf635762f31.tar.gz
scala-3ba0e87fed08f64066bf3412580fcdf635762f31.tar.bz2
scala-3ba0e87fed08f64066bf3412580fcdf635762f31.zip
fix #2122, test for #2116
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 2d2cec697a..f576c17ad1 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -2301,7 +2301,8 @@ trait Typers { self: Analyzer =>
case Typed(t, _) => tree2ConstArg(t, pt)
case tree => typed(tree, EXPRmode, pt) match {
- case l @ Literal(c) if !l.isErroneous =>
+ // null cannot be used as constant value for classfile annotations
+ case l @ Literal(c) if !(l.isErroneous || c.value == null) =>
Some(LiteralAnnotArg(c))
case _ =>
needConst(tree)