File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
compiler/src/dotty/tools/dotc/parsing
tests/neg-custom-args/captures Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -1419,6 +1419,7 @@ object Parsers {
1419
1419
private def getFunction (tree : Tree ): Option [Function ] = tree match {
1420
1420
case Parens (tree1) => getFunction(tree1)
1421
1421
case Block (Nil , tree1) => getFunction(tree1)
1422
+ case Function (_, _ : CapturesAndResult ) => None
1422
1423
case t : Function => Some (t)
1423
1424
case _ => None
1424
1425
}
Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments