From 8b9b98a22f364a35e32b674b9ef5188bee15a2c9 Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Wed, 18 Jan 2017 09:36:03 +0100 Subject: Fix singleton types in return values of doctool --- doc-tool/src/dotty/tools/dottydoc/model/factories.scala | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'doc-tool') diff --git a/doc-tool/src/dotty/tools/dottydoc/model/factories.scala b/doc-tool/src/dotty/tools/dottydoc/model/factories.scala index ad6bf7bae..0f4df7640 100644 --- a/doc-tool/src/dotty/tools/dottydoc/model/factories.scala +++ b/doc-tool/src/dotty/tools/dottydoc/model/factories.scala @@ -98,11 +98,7 @@ object factories { * def id[T](t: T): t.type = t * ``` */ - val name = t.show - if (!name.endsWith(".type")) - ctx.warning(s"unhandled return type found: $t") - - typeRef(name, query = t.typeSymbol.showFullName, params = params) + typeRef(t.name.show + ".type", params = params) } case ci: ClassInfo => @@ -127,7 +123,7 @@ object factories { AndTypeReference(expandTpe(left), expandTpe(right)) case c: ConstantType => - ConstantReference(c.show) + ConstantReference(c.value.show) case ref @ RefinedType(parent, rn, info) => expandTpe(parent) //FIXME: will be a refined HK, aka class Foo[X] { def bar: List[X] } or similar @@ -185,7 +181,8 @@ object factories { paramLists(annot.tpe) case (_: PolyParam | _: RefinedType | _: TypeRef | _: ThisType | - _: ExprType | _: OrType | _: AndType | _: HKApply | _: TermRef) => + _: ExprType | _: OrType | _: AndType | _: HKApply | + _: TermRef | _: ConstantType) => Nil // return types should not be in the paramlist } -- cgit v1.2.3