Skip to content

Commit 2f38758

Browse files
committed
Clarify methodTypeTag
1 parent dfa6414 commit 2f38758

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ 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, isImplicit: Boolean, isErased: Boolean): Int = {
445445
val implicitOffset =
446446
if (isContextual) 2
447447
else if (isImplicit) { assert(!isErased); 4 }

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+
isImplicit = 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)