diff options
author | Martin Odersky <odersky@gmail.com> | 2013-03-21 21:30:30 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-03-21 21:30:30 +0100 |
commit | 5b4f154c9e4c2c6ff48ac68b8d984e306853328f (patch) | |
tree | b79b81c86c31a7b6b6b34801dc81346413e5a699 /src/dotty/tools/dotc/core/pickling/UnPickler.scala | |
parent | 5ac2104e688409e24785cfe62cdc7e8ef0bc6428 (diff) | |
download | dotty-5b4f154c9e4c2c6ff48ac68b8d984e306853328f.tar.gz dotty-5b4f154c9e4c2c6ff48ac68b8d984e306853328f.tar.bz2 dotty-5b4f154c9e4c2c6ff48ac68b8d984e306853328f.zip |
More fixes to classfile reading.
Can now read all classes in scala.collection.generic. Some failures remain for their companion objects.
Diffstat (limited to 'src/dotty/tools/dotc/core/pickling/UnPickler.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/pickling/UnPickler.scala | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/UnPickler.scala b/src/dotty/tools/dotc/core/pickling/UnPickler.scala index 2f7bcc94d..4b3f17703 100644 --- a/src/dotty/tools/dotc/core/pickling/UnPickler.scala +++ b/src/dotty/tools/dotc/core/pickling/UnPickler.scala @@ -135,7 +135,7 @@ class UnPickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClassRoot: import cctx.debug val moduleRoot = moduleClassRoot.sourceModule.denot - println(s"moduleRoot = $moduleRoot, ${moduleRoot.isTerm}") // !!! DEBUG + assert(moduleRoot.isTerm) checkVersion() @@ -494,7 +494,8 @@ class UnPickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClassRoot: object localMemberUnpickler extends LocalUnpickler - class RootUnpickler(start: Coord, cls: Symbol) extends LocalClassUnpickler(cls) { + class RootUnpickler(start: Coord, cls: Symbol) + extends LocalClassUnpickler(cls) with SymbolLoaders.SecondCompleter { override def startCoord(denot: SymDenotation): Coord = start } @@ -581,7 +582,10 @@ class UnPickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClassRoot: sym.asType) } else TypeRef(pre, sym.name.asTypeName) val args = until(end, readTypeRef) - if (args.nonEmpty) println(s"reading app type $tycon ${tycon.typeSymbol.debugString} $args, owner = ${tycon.typeSymbol.owner.debugString}") // !!! DEBUG + if (args.nonEmpty) { // DEBUG + println(s"reading app type $tycon") + println(s"${tycon.typeSymbol.debugString} $args") + } tycon.appliedTo(args) case TYPEBOUNDStpe => TypeBounds(readTypeRef(), readTypeRef()) @@ -606,7 +610,10 @@ class UnPickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClassRoot: case METHODtpe | IMPLICITMETHODtpe => val restpe = readTypeRef() val params = until(end, readSymbolRef) - val maker = if (tag == METHODtpe) MethodType else ImplicitMethodType + def isImplicit = + tag == IMPLICITMETHODtpe || + params.nonEmpty && (params.head is Implicit) + val maker = if (isImplicit) ImplicitMethodType else MethodType maker.fromSymbols(params, restpe) case POLYtpe => val restpe = readTypeRef() |