Mark inherited definitions in `ShowAPI`.

Mark every inherited definition with `^inherited^` marker. This helps
understanding `ShowAPI`s output.
This commit is contained in:
Grzegorz Kossakowski 2013-01-23 22:47:46 -08:00 committed by Mark Harrah
parent f101bcd3d0
commit 5119ea2574
1 changed files with 4 additions and 1 deletions

View File

@ -213,7 +213,10 @@ trait ShowTypes
def show(s: Structure) = {
// don't show inherited class like definitions to avoid dealing with cycles
val safeInherited = s.inherited.filterNot(_.isInstanceOf[ClassLike])
concat(s.parents, t, " with ") + "\n{\n" + lines(safeInherited ++ s.declared, d) + "\n}"
val showInherited: Show[Definition] = new Show[Definition] {
def show(deff: Definition): String = "^inherited^ " + d.show(deff)
}
concat(s.parents, t, " with ") + "\n{\n" + lines(safeInherited, showInherited) + "\n" + lines(s.declared, d) + "\n}"
}
}
implicit def showAnnotated(implicit as: Show[Annotation], t: Show[Type]): Show[Annotated] =