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 {
625
625
given Trace = trace1
626
626
val cls = target.owner.enclosingClass.asClass
627
627
val ddef = target.defTree.asInstanceOf [DefDef ]
628
+ val argErrors = checkArgs
628
629
// normal method call
629
- if isSyntheticApply(meth) then
630
+ if argErrors.nonEmpty && isSyntheticApply(meth) then
630
631
val klass = meth.owner.companionClass.asClass
631
632
instantiate(klass, klass.primaryConstructor, args, source)
632
633
else
633
634
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
635
636
}
636
637
else if ref.canIgnoreMethodCall(target) then
637
638
Result (Hot , Nil )
You can’t perform that action at this time.
0 commit comments