Skip to content

Commit da7b35c

Browse files
committed
Fix application with multiple type params
1 parent 56f2448 commit da7b35c

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

compiler/src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,8 +1085,8 @@ trait Applications extends Compatibility {
10851085
val typedArgs = if (isNamed) typedNamedArgs(tree.args) else tree.args.mapconserve(typedType(_))
10861086
record("typedTypeApply")
10871087
typedExpr(tree.fun, PolyProto(typedArgs, pt)) match {
1088-
case _: TypeApply if !ctx.isAfterTyper =>
1089-
errorTree(tree, "illegal repeated type application")
1088+
/* case _: TypeApply if !ctx.isAfterTyper => //TODO: assess removing this is okay
1089+
errorTree(tree, "illegal repeated type application") */
10901090
case typedFn =>
10911091
typedFn.tpe.widen match {
10921092
case pt: PolyType =>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
def f_4[T]: [U] => T => T = ???
2+
def f_3[T][U]: T => T = ???
3+
def f_2[T][U](): T => T = ???
4+
def f_1[T <: Int][U <: String](): T => T = ???
5+
def f0[T <: Int][U <: String]: T => T = ???
6+
def f1[T <: Int][U <: String]: [X <: Unit] => X => X = ???
7+
def f2[T <: Int][U <: String](): [X <: Unit] => X => X = ???
8+
def f3[T <: Int][U <: String]()[X <: Unit]: X => X = ???
9+
10+
@main def test = {
11+
f_4[Int][String] //only one that works when lines 1088 to 1089 of Applications.scala are uncommented
12+
f_3[Int][String]
13+
f_2[Int][String]()
14+
f_1[Int][String]()
15+
f0[Int][String]
16+
f1[Int][String]
17+
f1[Int][Unit]
18+
f1[Int][String][Unit]
19+
f2[Int]()[Unit]
20+
f3[Int]()[Unit]
21+
}

0 commit comments

Comments
 (0)