@@ -36,7 +36,6 @@ import annotation.threadUnsafe
36
36
37
37
import scala .util .control .NonFatal
38
38
import dotty .tools .dotc .inlines .Inlines
39
- import dotty .tools .dotc .util .chaining .*
40
39
41
40
object Applications {
42
41
import tpd .*
@@ -759,11 +758,12 @@ trait Applications extends Compatibility {
759
758
else defaultArgument(normalizedFun, n, testOnly)
760
759
761
760
// a bug allowed empty parens to expand to implicit args: fail empty args for rewrite on migration
762
- def canSupplyImplicits = methodType.isImplicitMethod
763
- && (applyKind == ApplyKind . Using || false .tap : _ =>
761
+ def canSupplyImplicits =
762
+ inline def failEmptyArgs : false =
764
763
if Application .this .args.isEmpty then
765
764
fail(MissingImplicitParameterInEmptyArguments (methodType.paramNames(n), methString))
766
- )
765
+ false
766
+ methodType.isImplicitMethod && (applyKind == ApplyKind .Using || failEmptyArgs)
767
767
768
768
if ! defaultArg.isEmpty then
769
769
defaultArg.tpe.widen match
@@ -1175,8 +1175,7 @@ trait Applications extends Compatibility {
1175
1175
if fun1.symbol.name == nme.apply && fun1.span.isSynthetic then
1176
1176
fun1 match
1177
1177
case Select (qualifier, _) =>
1178
- def mapMessage (dia : Diagnostic ): Diagnostic =
1179
- dia match
1178
+ failedState.reporter.mapBufferedMessages:
1180
1179
case dia : Diagnostic .Error =>
1181
1180
dia.msg match
1182
1181
case msg : TypeMismatch =>
@@ -1189,8 +1188,8 @@ trait Applications extends Compatibility {
1189
1188
case _ => dia
1190
1189
case msg => dia
1191
1190
case dia => dia
1192
- failedState.reporter.mapBufferedMessages(mapMessage)
1193
1191
case _ => ()
1192
+ end if
1194
1193
1195
1194
def maybePatchBadParensForImplicit (failedState : TyperState )(using Context ): Boolean =
1196
1195
def rewrite (): Unit =
@@ -1199,8 +1198,7 @@ trait Applications extends Compatibility {
1199
1198
else " " // f() -> f where fun1.span.end == tree.span.point
1200
1199
rewrites.Rewrites .patch(tree.span.withStart(fun1.span.end), replace)
1201
1200
var retry = false
1202
- failedState.reporter.mapBufferedMessages: dia =>
1203
- dia match
1201
+ failedState.reporter.mapBufferedMessages:
1204
1202
case err : Diagnostic .Error =>
1205
1203
err.msg match
1206
1204
case msg : MissingImplicitParameterInEmptyArguments =>
0 commit comments