diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-06-15 12:20:45 -0400 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-08-13 15:16:14 -0700 |
commit | f91242c6959471b6c463538be8876a2cba29f3d3 (patch) | |
tree | b3e1de08923873688436440809773059dbaad4c0 /src/compiler/scala/tools/nsc/symtab | |
parent | e0d487d63144f2422d0be3bd8ac77e6f842e55ab (diff) | |
download | scala-f91242c6959471b6c463538be8876a2cba29f3d3.tar.gz scala-f91242c6959471b6c463538be8876a2cba29f3d3.tar.bz2 scala-f91242c6959471b6c463538be8876a2cba29f3d3.zip |
SI-7014 Annot arg may refer to annotated class's member
This only reduces the crasher to a warning.
Diffstat (limited to 'src/compiler/scala/tools/nsc/symtab')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala index 4e5204f283..2a8fe0428c 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala @@ -952,9 +952,14 @@ abstract class ClassfileParser { case ENUM_TAG => val t = pool.getType(index) val n = pool.getName(in.nextChar) - val s = t.typeSymbol.companionModule.info.decls.lookup(n) - assert(s != NoSymbol, t) - Some(LiteralAnnotArg(Constant(s))) + val module = t.typeSymbol.companionModule + val s = module.info.decls.lookup(n) + if (s != NoSymbol) Some(LiteralAnnotArg(Constant(s))) + else { + warning(s"""While parsing annotations in ${in.file}, could not find $n in enum $module.\nThis is likely due to an implementation restriction: an annotation argument cannot refer to a member of the annotated class (SI-7014).""") + None + } + case ARRAY_TAG => val arr = new ArrayBuffer[ClassfileAnnotArg]() var hasError = false |