Skip to content

Commit bb1f028

Browse files
committed
Document the special case in getFunction
1 parent 08376a5 commit bb1f028

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1419,7 +1419,11 @@ object Parsers {
14191419
private def getFunction(tree: Tree): Option[Function] = tree match {
14201420
case Parens(tree1) => getFunction(tree1)
14211421
case Block(Nil, tree1) => getFunction(tree1)
1422-
case Function(_, _: CapturesAndResult) => None
1422+
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
14231427
case t: Function => Some(t)
14241428
case _ => None
14251429
}

0 commit comments

Comments
 (0)