@@ -38,7 +38,6 @@ import scala.annotation.tailrec
38
38
import scala .util .control .NonFatal
39
39
import dotty .tools .dotc .cc .isRetains
40
40
import dotty .tools .dotc .inlines .Inlines
41
- import dotty .tools .dotc .util .chaining .*
42
41
43
42
object Applications {
44
43
import tpd .*
@@ -767,11 +766,12 @@ trait Applications extends Compatibility {
767
766
else defaultArgument(normalizedFun, n, testOnly)
768
767
769
768
// a bug allowed empty parens to expand to implicit args: fail empty args for rewrite on migration
770
- def canSupplyImplicits = methodType.isImplicitMethod
771
- && (applyKind == ApplyKind . Using || false .tap : _ =>
769
+ def canSupplyImplicits =
770
+ inline def failEmptyArgs : false =
772
771
if Application .this .args.isEmpty then
773
772
fail(MissingImplicitParameterInEmptyArguments (methodType.paramNames(n), methString))
774
- )
773
+ false
774
+ methodType.isImplicitMethod && (applyKind == ApplyKind .Using || failEmptyArgs)
775
775
776
776
if ! defaultArg.isEmpty then
777
777
defaultArg.tpe.widen match
@@ -1183,8 +1183,7 @@ trait Applications extends Compatibility {
1183
1183
if fun1.symbol.name == nme.apply && fun1.span.isSynthetic then
1184
1184
fun1 match
1185
1185
case Select (qualifier, _) =>
1186
- def mapMessage (dia : Diagnostic ): Diagnostic =
1187
- dia match
1186
+ failedState.reporter.mapBufferedMessages:
1188
1187
case dia : Diagnostic .Error =>
1189
1188
dia.msg match
1190
1189
case msg : TypeMismatch =>
@@ -1197,8 +1196,8 @@ trait Applications extends Compatibility {
1197
1196
case _ => dia
1198
1197
case msg => dia
1199
1198
case dia => dia
1200
- failedState.reporter.mapBufferedMessages(mapMessage)
1201
1199
case _ => ()
1200
+ end if
1202
1201
1203
1202
def maybePatchBadParensForImplicit (failedState : TyperState )(using Context ): Boolean =
1204
1203
def rewrite (): Unit =
@@ -1207,8 +1206,7 @@ trait Applications extends Compatibility {
1207
1206
else " " // f() -> f where fun1.span.end == tree.span.point
1208
1207
rewrites.Rewrites .patch(tree.span.withStart(fun1.span.end), replace)
1209
1208
var retry = false
1210
- failedState.reporter.mapBufferedMessages: dia =>
1211
- dia match
1209
+ failedState.reporter.mapBufferedMessages:
1212
1210
case err : Diagnostic .Error =>
1213
1211
err.msg match
1214
1212
case msg : MissingImplicitParameterInEmptyArguments =>
0 commit comments