aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-03-08 16:15:57 +0100
committerMartin Odersky <odersky@gmail.com>2013-03-08 16:15:57 +0100
commitc32e8062fdc6bd50c62ba100c02c8d3e21710447 (patch)
treebb587699041018e6410b4afa8179e0db3314a0f7 /src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
parent3c23e78324e0f555a62c66f9711b245d16dc8f26 (diff)
downloaddotty-c32e8062fdc6bd50c62ba100c02c8d3e21710447.tar.gz
dotty-c32e8062fdc6bd50c62ba100c02c8d3e21710447.tar.bz2
dotty-c32e8062fdc6bd50c62ba100c02c8d3e21710447.zip
Some fixes in ClassfileParser
Diffstat (limited to 'src/dotty/tools/dotc/core/pickling/ClassfileParser.scala')
-rw-r--r--src/dotty/tools/dotc/core/pickling/ClassfileParser.scala20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala b/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
index 5fbafb431..abdd94dad 100644
--- a/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
+++ b/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
@@ -32,15 +32,14 @@ class ClassfileParser(
protected var currentClassName: Name = _ // JVM name of the current class
protected var classTParams = Map[Name,Symbol]()
- protected var srcfile0 : Option[AbstractFile] = None //needs fleshing out
+ protected var srcfile0 : Option[AbstractFile] = None //needs fleshing out; this is presumably for the source file attribute, but it is neither set nor used anywhere.
def srcfile = srcfile0
private def currentIsTopLevel = !(classRoot.name contains '$')
- private def mismatchError(c: Symbol) = {
- throw new IOException("class file '%s' has location not matching its contents: contains ".format(in.file) + c)
- }
+ private def mismatchError(c: Symbol) =
+ throw new IOException(s"class file '${in.file}' has location not matching its contents: contains $c")
def run(): Unit = try {
cctx.debuglog("[class] >> " + classRoot.fullName)
@@ -108,13 +107,14 @@ class ClassfileParser(
superType :: ifaces
}
- var classInfo: Type = TempClassInfoType(parseParents, instanceScope, classRoot.symbol) // might be overridden by later parseAttributes
+ var classInfo: Type = TempClassInfoType(parseParents, instanceScope, classRoot.symbol)
+ // might be reassigned by later parseAttributes
val staticInfo = TempClassInfoType(List(), staticScope, moduleRoot.symbol)
enterOwnInnerClasses
classRoot.flags = sflags
- moduleRoot.flags = Flags.JavaDefined
+ moduleRoot.flags = Flags.JavaDefined | Flags.ModuleClassCreationFlags
setPrivateWithin(classRoot, jflags)
setPrivateWithin(moduleRoot, jflags)
@@ -153,6 +153,9 @@ class ClassfileParser(
if (!(sflags is Flags.Private) || name == nme.CONSTRUCTOR || settings.optimise.value)
cctx.newSymbol(
getOwner(jflags), name, sflags, memberCompleter, coord = start).entered
+ // skip rest of member for now
+ in.nextChar // info
+ skipAttributes
}
val memberCompleter = new LazyType {
@@ -712,10 +715,7 @@ class ClassfileParser(
private def setPrivateWithin(denot: SymDenotation, jflags: Int) {
if ((jflags & (JAVA_ACC_PRIVATE | JAVA_ACC_PUBLIC)) == 0)
- // See ticket #1687 for an example of when topLevelClass is NoSymbol: it
- // apparently occurs when processing v45.3 bytecode.
- if (denot.topLevelClass != NoSymbol)
- denot.privateWithin = denot.topLevelClass.owner
+ denot.privateWithin = denot.enclosingPackage
}
private def isPrivate(flags: Int) = (flags & JAVA_ACC_PRIVATE) != 0