File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -3876,7 +3876,7 @@ object Types {
3876
3876
3877
3877
val paramInfos : List [Type ] = paramInfosExp(this : @ unchecked)
3878
3878
val resType : Type = resultTypeExp(this : @ unchecked)
3879
- def paramPrecises (using Context ): List [Boolean ] = paramInfos.map(_.isPrecise)
3879
+ def paramPrecises (using Context ): List [Boolean ] = Nil
3880
3880
assert(resType.exists)
3881
3881
3882
3882
def companion : MethodTypeCompanion
@@ -4017,8 +4017,9 @@ object Types {
4017
4017
4018
4018
val declaredParamPrecises : List [Boolean ]
4019
4019
def paramPrecises (using Context ): List [Boolean ] =
4020
- if declaredParamPrecises.isEmpty then paramInfos.map(_ => false )
4021
- else declaredParamPrecises
4020
+ // if declaredParamPrecises.isEmpty then paramInfos.map(_ => false)
4021
+ // else
4022
+ declaredParamPrecises
4022
4023
4023
4024
@ threadUnsafe lazy val typeParams : List [LambdaParam ] =
4024
4025
paramNames.indices.toList.map(new LambdaParam (this , _))
Original file line number Diff line number Diff line change @@ -289,7 +289,9 @@ class PlainPrinter(_ctx: Context) extends Printer {
289
289
protected def paramsText (lam : LambdaType ): Text = {
290
290
def paramText (name : Name , tp : Type , precise : Boolean ) =
291
291
(if precise then " @precise " else " " ) ~ toText(name) ~ lambdaHash(lam) ~ toTextRHS(tp, isParameter = true )
292
- val precises = if (lam.paramPrecises.nonEmpty) lam.paramPrecises else lam.paramNames.map(_ => false )
292
+ val precises = lam match
293
+ case pt : TypeLambda if pt.paramPrecises.nonEmpty => pt.paramPrecises
294
+ case _ => lam.paramNames.map(_ => false )
293
295
Text (lam.paramNames.lazyZip(lam.paramInfos).lazyZip(precises).toList.map(paramText), " , " )
294
296
}
295
297
Original file line number Diff line number Diff line change @@ -1020,9 +1020,11 @@ trait Applications extends Compatibility {
1020
1020
*/
1021
1021
def realApplyWithRetry (using Context ): Tree = {
1022
1022
val firstAttemptCtx = ctx.fresh.setNewTyperState()
1023
- // tuple return type gets special treatment when arguments are precise
1024
- val argsPrecises = pt match
1025
- case AppliedType (_, args) if defn.isTupleNType(pt) => args.map(_.isPrecise)
1023
+ // tuple application for tuple return type gets special treatment when arguments are precise
1024
+ val argsPrecises = (tree.fun, pt.dealias) match
1025
+ case (untpd.TypedSplice (fun), AppliedType (_, args))
1026
+ if defn.isTupleClass(fun.tpe.classSymbol.companionClass) && defn.isTupleNType(pt) =>
1027
+ args.map(_.isPrecise)
1026
1028
case _ => Nil
1027
1029
val app = realApply(argsPrecises)(using firstAttemptCtx)
1028
1030
app match
You can’t perform that action at this time.
0 commit comments