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) {
171
171
else pickleRef()
172
172
}
173
173
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
+ }
176
179
case tpe : NamedType =>
177
180
if (tpe.name == tpnme.Apply && tpe.prefix.argInfos.nonEmpty && tpe.prefix.isInstantiatedLambda)
178
181
// instantiated lambdas are pickled as APPLIEDTYPE; #Apply will
@@ -187,10 +190,8 @@ class TreePickler(pickler: TastyPickler) {
187
190
pickleName(tpe.name); pickleType(tpe.prefix)
188
191
}
189
192
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)
194
195
else {
195
196
writeByte(THIS )
196
197
pickleType(tpe.tref)
@@ -259,6 +260,11 @@ class TreePickler(pickler: TastyPickler) {
259
260
println(i " error while pickling type $tpe" )
260
261
throw ex
261
262
}
263
+
264
+ def picklePackageRef (pkg : Symbol ): Unit = {
265
+ writeByte(TERMREFpkg )
266
+ pickleName(qualifiedName(pkg))
267
+ }
262
268
263
269
def pickleMethodic (result : Type , names : List [Name ], types : List [Type ]) =
264
270
withLength {
You can’t perform that action at this time.
0 commit comments