Skip to content

Commit 1b0b830

Browse files
committed
Still recheck Apply's function tree
1 parent 2a24379 commit 1b0b830

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/src/dotty/tools/dotc/transform/Recheck.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,9 @@ abstract class Recheck extends Phase, SymTransformer:
261261
mt.instantiate(argTypes)
262262

263263
def recheckApply(tree: Apply, pt: Type)(using Context): Type =
264-
// reuse the tree's type if the function was a signature polymorphic method, instead of rechecking it
265-
val funtpe = if tree.fun.symbol.originalSignaturePolymorphic.exists then tree.fun.tpe else recheck(tree.fun)
264+
val funTp = recheck(tree.fun)
265+
// reuse the tree's type on signature polymorphic methods, instead of using the (wrong) rechecked one
266+
val funtpe = if tree.fun.symbol.originalSignaturePolymorphic.exists then tree.fun.tpe else funTp
266267
funtpe.widen match
267268
case fntpe: MethodType =>
268269
assert(fntpe.paramInfos.hasSameLengthAs(tree.args))

0 commit comments

Comments
 (0)