diff options
author | Paul Phillips <paulp@improving.org> | 2009-03-29 17:09:10 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-03-29 17:09:10 +0000 |
commit | 370f060c6d40838fa467997070d591e16de5f2d3 (patch) | |
tree | 6f99080ed31d7ebb709654c1a153a8faa7af7f28 /src | |
parent | 06e3400b2cd813ff3dd5778e18ce1d17bc0a50d2 (diff) | |
download | scala-370f060c6d40838fa467997070d591e16de5f2d3.tar.gz scala-370f060c6d40838fa467997070d591e16de5f2d3.tar.bz2 scala-370f060c6d40838fa467997070d591e16de5f2d3.zip |
fix for #1837
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 55ad496c94..b14f6724e2 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -2105,11 +2105,10 @@ trait Typers { self: Analyzer => } } + lazy val annotationError = AnnotationInfo(ErrorType, Nil, Nil) typedConstr match { case t @ Apply(Select(New(tpt), nme.CONSTRUCTOR), args) => - if ((t.tpe==null) || t.tpe.isErroneous) { - AnnotationInfo(ErrorType, List(), List()) - } + if ((t.tpe==null) || t.tpe.isErroneous) annotationError else { val annType = tpt.tpe @@ -2155,9 +2154,12 @@ trait Typers { self: Analyzer => if (annType.typeSymbol.hasFlag(JAVA) && settings.target.value == "jvm-1.4") { context.warning (annot.constr.pos, "Java annotation will not be emitted in classfile unless you use the '-target:jvm-1.5' option") } - if (attrError) AnnotationInfo(ErrorType, List(), List()) + if (attrError) annotationError else AnnotationInfo(annType, constrArgs, nvPairs) } + // XXX what should the default case be doing here? + // see bug #1837 for code which induced a MatchError + case _ => annotationError } } |