Skip to content

Commit 37c96ca

Browse files
committed
Add support for another shape of Lambda types
1 parent b607e65 commit 37c96ca

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package example.typeAndObjects
2+
3+
4+
sealed trait Expr
5+
6+
object Expr{
7+
case class BinaryOp(offset: Int, lhs: Expr, op: BinaryOp.Op, rhs: Expr) extends Expr
8+
9+
object BinaryOp{
10+
sealed trait Op
11+
case object `<<` extends Op
12+
case object `>>` extends Op
13+
}
14+
}

scala3doc-testcases/src/tests/typeLambdas.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ type Id[T <: AnyKind]
1010

1111
type TL1 = Id[[X, Y] =>> Map[X,Y]]
1212

13-
type TL2 = Id[[X >: Int] =>> [Y <: String] =>> Map[X, Y]]
13+
type TL2 = Id[[X >: Int] =>> [Y <: String] =>> Map[X, Y]]
14+
15+
type LabdaA = List[(x: String) => List[x.type]]

scala3doc/src/dotty/dokka/tasty/TypesSupport.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ trait TypesSupport:
243243
inner(sc) ++ texts(" match {\n") ++ casesTexts ++ texts("}")
244244

245245
case ParamRef(TypeLambda(names, _, _), i) => texts(names.apply(i))
246+
247+
case ParamRef(m: MethodType, i) => texts(m.paramNames(i))
246248

247249
case RecursiveType(tp) => inner(tp)
248250

0 commit comments

Comments
 (0)