We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6dc3737 commit 08376a5Copy full SHA for 08376a5
compiler/src/dotty/tools/dotc/parsing/Parsers.scala
@@ -1419,6 +1419,7 @@ object Parsers {
1419
private def getFunction(tree: Tree): Option[Function] = tree match {
1420
case Parens(tree1) => getFunction(tree1)
1421
case Block(Nil, tree1) => getFunction(tree1)
1422
+ case Function(_, _: CapturesAndResult) => None
1423
case t: Function => Some(t)
1424
case _ => None
1425
}
tests/neg-custom-args/captures/i18518.scala
@@ -0,0 +1,5 @@
1
+import language.experimental.captureChecking
2
+type Foo1 = [R] -> (x: Unit) ->{} Unit // error
3
+type Foo2 = [R] -> (x: Unit) ->{cap} Unit // error
4
+type Foo3 = (c: Int^) -> [R] -> (x: Unit) ->{c} Unit // error
5
+type Foo4 = (c: Int^) -> [R] -> (x0: Unit) -> (x: Unit) ->{c} Unit
0 commit comments