Skip to content

Commit f00b0c9

Browse files
committed
No exceptions
1 parent 0af900a commit f00b0c9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

compiler/src/dotty/tools/dotc/transform/init/Semantic.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,10 +419,14 @@ class Semantic {
419419
else
420420
value.select(target, source, needResolve = false)
421421

422-
case Fun(body, params, thisV, klass, env) =>
422+
case Fun(body, params, thisV, klass, env2) =>
423423
// meth == NoSymbol for poly functions
424424
if meth.name.toString == "tupled" then Result(value, Nil) // a call like `fun.tupled`
425-
else eval(body, thisV, klass, cacheResult = true)
425+
else
426+
val env3 = Env(params.zip(args.widen).toMap).union(env2)
427+
use(env3) {
428+
eval(body, thisV, klass, cacheResult = true)
429+
}
426430

427431
case RefSet(refs) =>
428432
val resList = refs.map(_.call(meth, args, superType, source))

0 commit comments

Comments
 (0)