Skip to content

Commit 66fbad4

Browse files
committed
wip
1 parent b9b3f69 commit 66fbad4

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3876,7 +3876,7 @@ object Types {
38763876

38773877
val paramInfos: List[Type] = paramInfosExp(this: @unchecked)
38783878
val resType: Type = resultTypeExp(this: @unchecked)
3879-
def paramPrecises(using Context): List[Boolean] = paramInfos.map(_.isPrecise)
3879+
def paramPrecises(using Context): List[Boolean] = Nil
38803880
assert(resType.exists)
38813881

38823882
def companion: MethodTypeCompanion
@@ -4017,8 +4017,9 @@ object Types {
40174017

40184018
val declaredParamPrecises: List[Boolean]
40194019
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
40224023

40234024
@threadUnsafe lazy val typeParams: List[LambdaParam] =
40244025
paramNames.indices.toList.map(new LambdaParam(this, _))

compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,9 @@ class PlainPrinter(_ctx: Context) extends Printer {
289289
protected def paramsText(lam: LambdaType): Text = {
290290
def paramText(name: Name, tp: Type, precise: Boolean) =
291291
(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)
293295
Text(lam.paramNames.lazyZip(lam.paramInfos).lazyZip(precises).toList.map(paramText), ", ")
294296
}
295297

compiler/src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,9 +1020,11 @@ trait Applications extends Compatibility {
10201020
*/
10211021
def realApplyWithRetry(using Context): Tree = {
10221022
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)
10261028
case _ => Nil
10271029
val app = realApply(argsPrecises)(using firstAttemptCtx)
10281030
app match

0 commit comments

Comments
 (0)