Skip to content

Commit f18a306

Browse files
committed
wip
1 parent 66fbad4 commit f18a306

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4017,9 +4017,8 @@ 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
4022-
declaredParamPrecises
4020+
if declaredParamPrecises.isEmpty then paramNames.map(_ => false)
4021+
else declaredParamPrecises
40234022

40244023
@threadUnsafe lazy val typeParams: List[LambdaParam] =
40254024
paramNames.indices.toList.map(new LambdaParam(this, _))
@@ -4534,8 +4533,7 @@ object Types {
45344533
def copyBoundType(bt: BT): Type = bt.paramRefs(paramNum)
45354534
private var propagatedPrecise: Boolean = false
45364535
protected[Types] def setPropagatedPrecise(p: Boolean): Unit = propagatedPrecise = p
4537-
override def isPrecise(using Context): Boolean =
4538-
propagatedPrecise || binder.paramPrecises.nonEmpty && binder.paramPrecises(paramNum)
4536+
override def isPrecise(using Context): Boolean = propagatedPrecise || binder.paramPrecises(paramNum)
45394537
/** Optimized version of occursIn, avoid quadratic blowup when solving
45404538
* constraints over large ground types.
45414539
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
290290
def paramText(name: Name, tp: Type, precise: Boolean) =
291291
(if precise then "@precise " else "") ~ toText(name) ~ lambdaHash(lam) ~ toTextRHS(tp, isParameter = true)
292292
val precises = lam match
293-
case pt: TypeLambda if pt.paramPrecises.nonEmpty => pt.paramPrecises
293+
case pt: TypeLambda => pt.paramPrecises
294294
case _ => lam.paramNames.map(_ => false)
295295
Text(lam.paramNames.lazyZip(lam.paramInfos).lazyZip(precises).toList.map(paramText), ", ")
296296
}

0 commit comments

Comments
 (0)