Skip to content

Commit

Permalink
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions scaladoc-testcases/src/tests/contextfunctions.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package tests.contextfunctions

val x: Int ?=> Float
= 5.0f
7 changes: 4 additions & 3 deletions scaladoc/src/dotty/tools/scaladoc/tasty/TypesSupport.scala
Original file line number Diff line number Diff line change
@@ -182,18 +182,19 @@ trait TypesSupport:
++ plain(" ").l
++ inner(typeList.last)
else if t.isFunctionType then
val arrow = if t.isContextFunctionType then " ?=> " else " => "
typeList match
case Nil =>
Nil
case Seq(rtpe) =>
plain("()").l ++ keyword(" => ").l ++ inner(rtpe)
plain("()").l ++ keyword(arrow).l ++ inner(rtpe)
case Seq(arg, rtpe) =>
val partOfSignature = arg match
case byName: ByNameType => plain("(").l ++ inner(byName) ++ plain(")").l
case _ => inner(arg)
partOfSignature ++ keyword(" => ").l ++ inner(rtpe)
partOfSignature ++ keyword(arrow).l ++ inner(rtpe)
case args =>
plain("(").l ++ commas(args.init.map(inner)) ++ plain(")").l ++ keyword(" => ").l ++ inner(args.last)
plain("(").l ++ commas(args.init.map(inner)) ++ plain(")").l ++ keyword(arrow).l ++ inner(args.last)
else if t.isTupleN then
typeList match
case Nil =>
Original file line number Diff line number Diff line change
@@ -90,3 +90,5 @@ class ContextBounds extends SignatureTest("contextBounds", SignatureTest.all)
class FBoundedTypeParameters extends SignatureTest("fboundedTypeParameters", SignatureTest.all)

class Exports extends SignatureTest("exports2", SignatureTest.all, sourceFiles = List("exports1", "exports2"))

class ContextFunctions extends SignatureTest("contextfunctions", SignatureTest.all)

0 comments on commit 60aba09

Please sign in to comment.