File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
compiler/src/dotty/tools/dotc/transform/init Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -625,13 +625,14 @@ object Semantic {
625625 given Trace = trace1
626626 val cls = target.owner.enclosingClass.asClass
627627 val ddef = target.defTree.asInstanceOf [DefDef ]
628+ val argErrors = checkArgs
628629 // normal method call
629- if isSyntheticApply(meth) then
630+ if argErrors.nonEmpty && isSyntheticApply(meth) then
630631 val klass = meth.owner.companionClass.asClass
631632 instantiate(klass, klass.primaryConstructor, args, source)
632633 else
633634 withEnv(if isLocal then env else Env .empty) {
634- eval(ddef.rhs, ref, cls, cacheResult = true ) ++ checkArgs
635+ eval(ddef.rhs, ref, cls, cacheResult = true ) ++ argErrors
635636 }
636637 else if ref.canIgnoreMethodCall(target) then
637638 Result (Hot , Nil )
You can’t perform that action at this time.
0 commit comments