aboutsummaryrefslogtreecommitdiff
path: root/dottydoc
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-07-20 10:23:47 +0200
committerFelix Mulder <felix.mulder@gmail.com>2016-08-19 15:37:31 +0200
commitc1b57e984a448248569adab579e91a79235ba1e7 (patch)
tree2fe3f1d8cd998ca1e1860902323f367d619ffeec /dottydoc
parent58b83ce614ae65d3a57517d37a66935e42a10d2d (diff)
downloaddotty-c1b57e984a448248569adab579e91a79235ba1e7.tar.gz
dotty-c1b57e984a448248569adab579e91a79235ba1e7.tar.bz2
dotty-c1b57e984a448248569adab579e91a79235ba1e7.zip
Correctly parse tuples, functions and applied types like `Map[K,V]` from compiler internals
Diffstat (limited to 'dottydoc')
-rw-r--r--dottydoc/shared/src/main/scala/dotty/tools/dottydoc/model/factories.scala11
1 files changed, 10 insertions, 1 deletions
diff --git a/dottydoc/shared/src/main/scala/dotty/tools/dottydoc/model/factories.scala b/dottydoc/shared/src/main/scala/dotty/tools/dottydoc/model/factories.scala
index bd38701d9..c6ef6cb35 100644
--- a/dottydoc/shared/src/main/scala/dotty/tools/dottydoc/model/factories.scala
+++ b/dottydoc/shared/src/main/scala/dotty/tools/dottydoc/model/factories.scala
@@ -69,7 +69,16 @@ object factories {
// Becomes: def companion: [+X0] -> collection.Iterable[X0]
typeRef(tl.show + " (not handled)")
case AppliedType(tycon, args) =>
- FunctionReference(args.init.map(expandTpe(_, Nil)), expandTpe(args.last))
+ val cls = tycon.typeSymbol
+ if (tycon.isRepeatedParam)
+ expandTpe(args.head)
+ else if (defn.isFunctionClass(cls))
+ FunctionReference(args.init.map(expandTpe(_, Nil)), expandTpe(args.last))
+ else if (defn.isTupleClass(cls))
+ TupleReference(args.map(expandTpe(_, Nil)))
+ else
+ typeRef(tycon.show, params = args.map(expandTpe(_, Nil)))
+
case ref @ RefinedType(parent, rn, info) =>
expandTpe(parent) //FIXME: will be a refined HK, aka class Foo[X] { def bar: List[X] } or similar
case ref @ HKApply(tycon, args) =>