aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-03-25 12:18:34 +0100
committerMartin Odersky <odersky@gmail.com>2013-03-25 12:18:34 +0100
commit27a508c50482f4053591ed740f09ecced5bf749b (patch)
tree936cf263cc1236bb308cc786c0f7ee0cdc0f2fa8 /src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
parent4a17f0d1e17adecbdc4755bf719feff18d115318 (diff)
downloaddotty-27a508c50482f4053591ed740f09ecced5bf749b.tar.gz
dotty-27a508c50482f4053591ed740f09ecced5bf749b.tar.bz2
dotty-27a508c50482f4053591ed740f09ecced5bf749b.zip
More fixes for classfile reading.
In particular: Survive malformed type errors. Make trees cloneable. and others more.
Diffstat (limited to 'src/dotty/tools/dotc/core/pickling/ClassfileParser.scala')
-rw-r--r--src/dotty/tools/dotc/core/pickling/ClassfileParser.scala14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala b/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
index 11dcd2152..6b7721213 100644
--- a/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
+++ b/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
@@ -16,7 +16,9 @@ import io.AbstractFile
class ClassfileParser(
classfile: AbstractFile,
classRoot: ClassDenotation,
- moduleRoot: ClassDenotation)(implicit cctx: CondensedContext) {
+ moduleRoot: ClassDenotation)(cctx0: CondensedContext) {
+
+ implicit val cctx: CondensedContext = cctx0.fresh.withCheckPrefix(false)
import ClassfileConstants._
import cctx.base.{settings, loaders, definitions => defn}
@@ -32,9 +34,11 @@ 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; this is presumably for the source file attribute, but it is neither set nor used anywhere.
- def srcfile = srcfile0
+ classRoot.info = new LazyClassInfo {
+ val decls = instanceScope
+ def complete(denot: SymDenotation) = unsupported("complete")
+ }
private def currentIsTopLevel = classRoot.owner is Flags.PackageClass
@@ -336,9 +340,11 @@ class ClassfileParser(
val start = index
while (sig(index) != '>') {
val tpname = subName(':'.==).toTypeName
+ val expname = if (owner.isClass) tpname.expandedName(owner) else tpname
val s = cctx.newSymbol(
- owner, tpname, Flags.TypeParamCreationFlags,
+ owner, expname, Flags.TypeParamCreationFlags,
typeParamCompleter(index), coord = indexCoord(index))
+ if (owner.isClass) owner.asClass.enter(s, owner.preCompleteDecls)
tparams = tparams + (tpname -> s)
sig2typeBounds(tparams, skiptvs = true)
newTParams += s