Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion compiler/src/dotty/tools/dotc/printing/Formatting.scala
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ object Formatting {
else nonSensicalStartTag + str + nonSensicalEndTag
}

private type Recorded = AnyRef /*Symbol | TypeParamRef | SkolemType */
private type Recorded = AnyRef /*Symbol | ParamRef | SkolemType */

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

Expand Down Expand Up @@ -187,6 +187,7 @@ object Formatting {
private def explanations(seen: Seen)(implicit ctx: Context): String = {
def needsExplanation(entry: Recorded) = entry match {
case param: TypeParamRef => ctx.typerState.constraint.contains(param)
case param: TermParamRef => false
case skolem: SkolemType => true
case sym: Symbol =>
ctx.gadt.bounds.contains(sym) && ctx.gadt.bounds(sym) != TypeBounds.empty
Expand Down
4 changes: 4 additions & 0 deletions tests/neg/i4377.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
object App {
type T[A <: ((a : A) => a.type)] = A
val a: T[_] = ??? // error
}