Skip to content

Fix #4377: Add missing case in Formatting #4400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2018
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
}