Skip to content

Commit 9224cee

Browse files
committed
Fix #4377 Add missing case in Formatting
1 parent e77604d commit 9224cee

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ object Formatting {
106106
else nonSensicalStartTag + str + nonSensicalEndTag
107107
}
108108

109-
private type Recorded = AnyRef /*Symbol | TypeParamRef | SkolemType */
109+
private type Recorded = AnyRef /*Symbol | ParamRef | SkolemType */
110110

111111
private class Seen extends mutable.HashMap[String, List[Recorded]] {
112112

@@ -187,6 +187,7 @@ object Formatting {
187187
private def explanations(seen: Seen)(implicit ctx: Context): String = {
188188
def needsExplanation(entry: Recorded) = entry match {
189189
case param: TypeParamRef => ctx.typerState.constraint.contains(param)
190+
case param: TermParamRef => false
190191
case skolem: SkolemType => true
191192
case sym: Symbol =>
192193
ctx.gadt.bounds.contains(sym) && ctx.gadt.bounds(sym) != TypeBounds.empty

tests/neg/i4377.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
object App {
2+
type T[A <: ((a : A) => a.type)] = A
3+
val a: T[_] = ??? // error
4+
}

0 commit comments

Comments
 (0)