summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2014-03-26 12:39:24 +0100
committerGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2014-03-26 12:39:24 +0100
commitc74e1325ff1514b1042c959b0b268b3c6bf8d349 (patch)
tree3ac99232469e17ff0d69113ce2ff2fbc59ab6050 /src
parent2af68eec522c97af14b8fad372fc3c0addf7d604 (diff)
parent8262ed2fc618d27258eb975fd401b31f1064cc3e (diff)
downloadscala-c74e1325ff1514b1042c959b0b268b3c6bf8d349.tar.gz
scala-c74e1325ff1514b1042c959b0b268b3c6bf8d349.tar.bz2
scala-c74e1325ff1514b1042c959b0b268b3c6bf8d349.zip
Merge pull request #3655 from retronym/ticket/8442
SI-8442 Ignore stub annotation symbols in `AnnotationInfo#matches`
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala10
-rw-r--r--src/reflect/scala/reflect/internal/AnnotationInfos.scala2
2 files changed, 8 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
index 2955986a7e..6991cfa37b 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
@@ -436,9 +436,13 @@ abstract class ClassfileParser {
// SI-5593 Scaladoc's current strategy is to visit all packages in search of user code that can be documented
// therefore, it will rummage through the classpath triggering errors whenever it encounters package objects
// that are not in their correct place (see bug for details)
- if (!settings.isScaladoc)
- warning(s"Class $name not found - continuing with a stub.")
- return NoSymbol.newClass(name.toTypeName)
+
+ // TODO More consistency with use of stub symbols in `Unpickler`
+ // - better owner than `NoSymbol`
+ // - remove eager warning
+ val msg = s"Class $name not found - continuing with a stub."
+ if (!settings.isScaladoc) warning(msg)
+ return NoSymbol.newStubSymbol(name.toTypeName, msg)
}
val completer = new global.loaders.ClassfileLoader(file)
var owner: Symbol = rootMirror.RootClass
diff --git a/src/reflect/scala/reflect/internal/AnnotationInfos.scala b/src/reflect/scala/reflect/internal/AnnotationInfos.scala
index 032b45316e..80b6b16d0a 100644
--- a/src/reflect/scala/reflect/internal/AnnotationInfos.scala
+++ b/src/reflect/scala/reflect/internal/AnnotationInfos.scala
@@ -292,7 +292,7 @@ trait AnnotationInfos extends api.Annotations { self: SymbolTable =>
*/
def defaultTargets = symbol.annotations map (_.symbol) filter isMetaAnnotation
// Test whether the typeSymbol of atp conforms to the given class.
- def matches(clazz: Symbol) = symbol isNonBottomSubClass clazz
+ def matches(clazz: Symbol) = !symbol.isInstanceOf[StubSymbol] && (symbol isNonBottomSubClass clazz)
// All subtrees of all args are considered.
def hasArgWhich(p: Tree => Boolean) = args exists (_ exists p)