Skip to content

Commit eb160eb

Browse files
committed
subst new ctx in funproto
1 parent 6d4b65f commit eb160eb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4361,7 +4361,13 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
43614361

43624362
def doesntContainsWildcards = {
43634363
val newCtx = ctx.fresh.setNewScope.setReporter(new reporting.ThrowingReporter(NoReporter))
4364-
val pt1 = pt.deepenProtoTrans(using newCtx)
4364+
val substCtxMap = new TypeMap():
4365+
def apply(tp: Type): Type = tp match
4366+
case tp: FunProto => mapOver(
4367+
tp.derivedFunProto(resultType = tp.resultType(using newCtx)).withContext(newCtx)
4368+
)
4369+
case tp => mapOver(tp)
4370+
val pt1 = substCtxMap(pt).deepenProtoTrans(using newCtx)
43654371
try {
43664372
isFullyDefined(pt1, ForceDegree.none, ifProto = true)(using newCtx)
43674373
} catch {

0 commit comments

Comments
 (0)