Skip to content

Commit c806126

Browse files
committed
Remove isTrackableRef check in BiTypeMap.backward
1 parent 81e05a2 commit c806126

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

Diff for: compiler/src/dotty/tools/dotc/cc/Setup.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ class Setup extends PreRecheck, SymTransformer, SetupAPI:
570570
// For example, `(x: T, y: x.f.type) => Unit`. In this case, when we
571571
// substitute `x.f.type`, `x` becomes a `TermParamRef`. But the new method
572572
// type is still under initialization and `paramInfos` is still `null`,
573-
// so the new `NamedType` will not have a denoation.
573+
// so the new `NamedType` will not have a denotation.
574574
def adaptedInfo(psym: Symbol, info: mt.PInfo): mt.PInfo = mt.companion match
575575
case mtc: MethodTypeCompanion => mtc.adaptParamInfo(psym, info).asInstanceOf[mt.PInfo]
576576
case _ => info

Diff for: compiler/src/dotty/tools/dotc/core/Types.scala

+2-13
Original file line numberDiff line numberDiff line change
@@ -6070,22 +6070,11 @@ object Types extends TypeUtils {
60706070
def inverse: BiTypeMap
60716071

60726072
/** A restriction of this map to a function on tracked CaptureRefs */
6073-
def forward(ref: CaptureRef): CaptureRef =
6074-
val result = this(ref)
6075-
/*def ensureTrackable(tp: Type): CaptureRef = tp match
6076-
case tp: CaptureRef =>
6077-
if tp.isTrackableRef then tp
6078-
else ensureTrackable(tp.underlying)
6079-
case tp: TypeAlias =>
6080-
ensureTrackable(tp.alias)
6081-
case _ =>
6082-
assert(false, i"not a trackable captureRef ref: $result, ${result.underlyingIterator.toList}")
6083-
ensureTrackable(result)*/
6084-
result.asInstanceOf[CaptureRef]
6073+
def forward(ref: CaptureRef): CaptureRef = this(ref).asInstanceOf[CaptureRef]
60856074

60866075
/** A restriction of the inverse to a function on tracked CaptureRefs */
60876076
def backward(ref: CaptureRef): CaptureRef = inverse(ref) match
6088-
case result: CaptureRef if result.isTrackableRef => result
6077+
case result: CaptureRef => result
60896078
end BiTypeMap
60906079

60916080
abstract class TypeMap(implicit protected var mapCtx: Context)

0 commit comments

Comments
 (0)