diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-01-07 08:58:53 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-01-26 15:41:07 +0100 |
commit | eb4b06544a4362231357686c39beef9dbe00d932 (patch) | |
tree | 20533826a3ab198915ccba546c0ca6ab18fe7841 /src/compiler/scala/tools/nsc/typechecker/Typers.scala | |
parent | 3813d75fa8c83a593859919f5979a1a217e8da44 (diff) | |
download | scala-eb4b06544a4362231357686c39beef9dbe00d932.tar.gz scala-eb4b06544a4362231357686c39beef9dbe00d932.tar.bz2 scala-eb4b06544a4362231357686c39beef9dbe00d932.zip |
Wider use of isTopLevel
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 45f290d6c1..2298b9b2a4 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1919,7 +1919,7 @@ trait Typers extends Adaptations with Tags { if (clazz.isTrait && hasSuperArgs(parents1.head)) ConstrArgsInParentOfTraitError(parents1.head, clazz) - if ((clazz isSubClass ClassfileAnnotationClass) && !clazz.owner.isPackageClass) + if ((clazz isSubClass ClassfileAnnotationClass) && !clazz.isTopLevel) unit.error(clazz.pos, "inner classes cannot be classfile annotations") if (!phase.erasedTypes && !clazz.info.resultType.isError) // @S: prevent crash for duplicated type members @@ -4788,7 +4788,7 @@ trait Typers extends Adaptations with Tags { else if (isPredefMemberNamed(sym, nme.classOf) && pt.typeSymbol == ClassClass && pt.typeArgs.nonEmpty) typedClassOf(tree, TypeTree(pt.typeArgs.head)) else { - val pre1 = if (sym.owner.isPackageClass) sym.owner.thisType else if (qual == EmptyTree) NoPrefix else qual.tpe + val pre1 = if (sym.isTopLevel) sym.owner.thisType else if (qual == EmptyTree) NoPrefix else qual.tpe val tree1 = if (qual == EmptyTree) tree else atPos(tree.pos)(Select(atPos(tree.pos.focusStart)(qual), name)) val (tree2, pre2) = makeAccessible(tree1, sym, pre1, qual) // SI-5967 Important to replace param type A* with Seq[A] when seen from from a reference, to avoid |