Skip to content

Commit 3aa2eb0

Browse files
committed
Fine-tuning contexts for resolve overloading
When resolving overloading with a fun proto type, we need to evaluate the arguments in the current context, not in an exploring context. Reason: The argument types might contain type valiables that are constrained in the context and that needs to be maintained.
1 parent 79c4490 commit 3aa2eb0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,7 @@ class Typer extends Namer with Applications with Implicits {
11501150
val alts = altDenots map (alt =>
11511151
TermRef.withSig(ref.prefix, ref.name, alt.info.signature, alt))
11521152
def expectedStr = err.expectedTypeStr(pt)
1153-
resolveOverloaded(alts, pt)(ctx.fresh.withExploreTyperState) match {
1153+
resolveOverloaded(alts, pt) match {
11541154
case alt :: Nil =>
11551155
adapt(tree.withType(alt), pt)
11561156
case Nil =>

0 commit comments

Comments
 (0)