diff options
author | James Iry <jamesiry@gmail.com> | 2013-08-14 10:42:31 -0700 |
---|---|---|
committer | James Iry <jamesiry@gmail.com> | 2013-08-14 10:42:31 -0700 |
commit | f1886cdc9d921d5878105c59b0b22a812b3e4458 (patch) | |
tree | 3ece8ed41f218dea8aadcd3eea0e9eb614427ca2 /src/compiler | |
parent | e589a4a9cc98284ec391345d5e27c3d1538917e2 (diff) | |
parent | f91242c6959471b6c463538be8876a2cba29f3d3 (diff) | |
download | scala-f1886cdc9d921d5878105c59b0b22a812b3e4458.tar.gz scala-f1886cdc9d921d5878105c59b0b22a812b3e4458.tar.bz2 scala-f1886cdc9d921d5878105c59b0b22a812b3e4458.zip |
Merge pull request #2829 from adriaanm/ticket-7014
SI-7014 Annot arg may refer to annotated class's member
Diffstat (limited to 'src/compiler')
-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 |