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.
getFunction
1 parent 08376a5 commit bb1f028Copy full SHA for bb1f028
compiler/src/dotty/tools/dotc/parsing/Parsers.scala
@@ -1419,7 +1419,11 @@ 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
+ case Function(_, _: CapturesAndResult) =>
1423
+ // A function tree like this will be desugared
1424
+ // into a capturing type in the typer,
1425
+ // so None is returned.
1426
+ None
1427
case t: Function => Some(t)
1428
case _ => None
1429
}
0 commit comments