File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
src/dotty/tools/dotc/core/pickling Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -171,8 +171,11 @@ class TreePickler(pickler: TastyPickler) {
171171 else pickleRef()
172172 }
173173 case tpe : TermRefWithSignature =>
174- writeByte(TERMREF )
175- pickleNameAndSig(tpe.name, tpe.signature); pickleType(tpe.prefix)
174+ if (tpe.symbol.is(Flags .Package )) picklePackageRef(tpe.symbol)
175+ else {
176+ writeByte(TERMREF )
177+ pickleNameAndSig(tpe.name, tpe.signature); pickleType(tpe.prefix)
178+ }
176179 case tpe : NamedType =>
177180 if (tpe.name == tpnme.Apply && tpe.prefix.argInfos.nonEmpty && tpe.prefix.isInstantiatedLambda)
178181 // instantiated lambdas are pickled as APPLIEDTYPE; #Apply will
@@ -187,10 +190,8 @@ class TreePickler(pickler: TastyPickler) {
187190 pickleName(tpe.name); pickleType(tpe.prefix)
188191 }
189192 case tpe : ThisType =>
190- if (tpe.cls.is(Flags .Package ) && ! tpe.cls.isEffectiveRoot) {
191- writeByte(TERMREFpkg )
192- pickleName(qualifiedName(tpe.cls))
193- }
193+ if (tpe.cls.is(Flags .Package ) && ! tpe.cls.isEffectiveRoot)
194+ picklePackageRef(tpe.cls)
194195 else {
195196 writeByte(THIS )
196197 pickleType(tpe.tref)
@@ -259,6 +260,11 @@ class TreePickler(pickler: TastyPickler) {
259260 println(i " error while pickling type $tpe" )
260261 throw ex
261262 }
263+
264+ def picklePackageRef (pkg : Symbol ): Unit = {
265+ writeByte(TERMREFpkg )
266+ pickleName(qualifiedName(pkg))
267+ }
262268
263269 def pickleMethodic (result : Type , names : List [Name ], types : List [Type ]) =
264270 withLength {
You can’t perform that action at this time.
0 commit comments