aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/printing
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-10-23 21:16:25 +0200
committerMartin Odersky <odersky@gmail.com>2013-10-23 21:16:25 +0200
commit6d70392b11a658bdcbc4a21898370ca58c707c44 (patch)
tree4f7c9fe578c039c6741e541e569289dd9199bdfc /src/dotty/tools/dotc/printing
parent344f0444ac708e4ee885deeb54d070924487fa31 (diff)
downloaddotty-6d70392b11a658bdcbc4a21898370ca58c707c44.tar.gz
dotty-6d70392b11a658bdcbc4a21898370ca58c707c44.tar.bz2
dotty-6d70392b11a658bdcbc4a21898370ca58c707c44.zip
Making printing refined types more robust.
Refined type printing gave {<none>} if the refined name did not have a member in the parent. We now print the refined name instead.
Diffstat (limited to 'src/dotty/tools/dotc/printing')
-rw-r--r--src/dotty/tools/dotc/printing/RefinedPrinter.scala7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/printing/RefinedPrinter.scala b/src/dotty/tools/dotc/printing/RefinedPrinter.scala
index 6d6442d2f..93e77ac2f 100644
--- a/src/dotty/tools/dotc/printing/RefinedPrinter.scala
+++ b/src/dotty/tools/dotc/printing/RefinedPrinter.scala
@@ -67,8 +67,11 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
super.refinementNameString(tp)
else {
val tsym = tp.member(tp.refinedName).symbol
- val name = tsym.originalName
- nameString(if (tsym is ExpandedTypeParam) name.asTypeName.unexpandedName() else name)
+ if (!tsym.exists) super.refinementNameString(tp)
+ else {
+ val name = tsym.originalName
+ nameString(if (tsym is ExpandedTypeParam) name.asTypeName.unexpandedName() else name)
+ }
}
override def toText(tp: Type): Text = controlled {