Skip to content

Commit 6792b34

Browse files
committed
Clarify methodTypeTag
1 parent 32700e9 commit 6792b34

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

compiler/src/dotty/tools/dotc/core/tasty/TastyFormat.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,10 +441,10 @@ object TastyFormat {
441441
final val MATCHtype = 190
442442
final val MATCHtpt = 191
443443

444-
def methodType(isContextual: Boolean, isImplicit: Boolean, isErased: Boolean): Int = {
444+
def methodTypeTag(isContextual: Boolean, isOldImplicit: Boolean, isErased: Boolean): Int = {
445445
val implicitOffset =
446446
if (isContextual) 2
447-
else if (isImplicit) { assert(!isErased); 4 }
447+
else if (isOldImplicit) { assert(!isErased); 4 }
448448
else 0
449449
val erasedOffset = if (isErased) 1 else 0
450450
METHODtype + erasedOffset + implicitOffset

compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,11 @@ class TreePickler(pickler: TastyPickler) {
259259
case tpe: PolyType if richTypes =>
260260
pickleMethodic(POLYtype, tpe)
261261
case tpe: MethodType if richTypes =>
262-
pickleMethodic(methodType(tpe.isContextual, tpe.isImplicitMethod, tpe.isErasedMethod), tpe)
262+
val tag = methodTypeTag(
263+
isContextual = tpe.isContextual,
264+
isOldImplicit = tpe.isImplicitMethod && !tpe.isContextual,
265+
isErased = tpe.isErasedMethod)
266+
pickleMethodic(tag, tpe)
263267
case tpe: ParamRef =>
264268
assert(pickleParamRef(tpe), s"orphan parameter reference: $tpe")
265269
case tpe: LazyRef =>

0 commit comments

Comments
 (0)