@@ -284,11 +284,13 @@ trait NamesDefaults { self: Analyzer =>
284284 case Typed (expr, Ident (tpnme.WILDCARD_STAR )) => expr.tpe
285285 case _ => seqType(arg.tpe)
286286 }
287- else
288- // Note stabilizing can lead to a non-conformant argument when existentials are involved, e.g. neg/t3507-old.scala, hence the filter.
289- // We have to deconst or types inferred from literal arguments will be Constant(_), e.g. pos/z1730.scala.
290- gen.stableTypeFor(arg).filter(_ <:< paramTpe).getOrElse(arg.tpe).deconst
291- )
287+ else {
288+ // TODO In 83c9c764b, we tried to a stable type here to fix SI-7234. But the resulting TypeTree over a
289+ // singleton type without an original TypeTree fails to retypecheck after a resetLocalAttrs (SI-7516),
290+ // which is important for (at least) macros.
291+ arg.tpe
292+ }
293+ ).widen // have to widen or types inferred from literal defaults will be singletons
292294 val s = context.owner.newValue(unit.freshTermName(" x$" ), arg.pos) setInfo {
293295 val tp = if (byName) functionType(Nil , argTpe) else argTpe
294296 uncheckedBounds(tp)
@@ -334,9 +336,12 @@ trait NamesDefaults { self: Analyzer =>
334336 // type the application without names; put the arguments in definition-site order
335337 val typedApp = doTypedApply(tree, funOnly, reorderArgs(namelessArgs, argPos), mode, pt)
336338 typedApp match {
337- // Extract the typed arguments, restore the call-site evaluation order (using
338- // ValDef's in the block), change the arguments to these local values.
339- case Apply (expr, typedArgs) if ! (typedApp :: typedArgs).exists(_.isErrorTyped) => // bail out with erroneous args, see SI-7238
339+ case Apply (expr, typedArgs) if (typedApp :: typedArgs).exists(_.isErrorTyped) =>
340+ setError(tree) // bail out with and erroneous Apply *or* erroneous arguments, see SI-7238, SI-7509
341+ case Apply (expr, typedArgs) =>
342+ // Extract the typed arguments, restore the call-site evaluation order (using
343+ // ValDef's in the block), change the arguments to these local values.
344+
340345 // typedArgs: definition-site order
341346 val formals = formalTypes(expr.tpe.paramTypes, typedArgs.length, removeByName = false , removeRepeated = false )
342347 // valDefs: call-site order
0 commit comments