diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2017-01-18 09:36:03 +0100 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2017-01-31 14:32:39 +0100 |
commit | 8b9b98a22f364a35e32b674b9ef5188bee15a2c9 (patch) | |
tree | cf0f5f83ae683c5332c2811afdcdeec7342d8363 /doc-tool | |
parent | 7d879b503f710d9d275b54a4428a7231e2a19f54 (diff) | |
download | dotty-8b9b98a22f364a35e32b674b9ef5188bee15a2c9.tar.gz dotty-8b9b98a22f364a35e32b674b9ef5188bee15a2c9.tar.bz2 dotty-8b9b98a22f364a35e32b674b9ef5188bee15a2c9.zip |
Fix singleton types in return values of doctool
Diffstat (limited to 'doc-tool')
-rw-r--r-- | doc-tool/src/dotty/tools/dottydoc/model/factories.scala | 11 |
1 files changed, 4 insertions, 7 deletions
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 } |