File tree Expand file tree Collapse file tree 3 files changed +5
-0
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 3 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -1611,6 +1611,8 @@ object desugar {
16111611 def makePolyFunction (targs : List [Tree ], body : Tree ): Tree = body match {
16121612 case Parens (body1) =>
16131613 makePolyFunction(targs, body1)
1614+ case Block (Nil , body1) =>
1615+ makePolyFunction(targs, body1)
16141616 case Function (vargs, res) =>
16151617 assert(targs.nonEmpty)
16161618 // TODO: Figure out if we need a `PolyFunctionWithMods` instead.
Original file line number Diff line number Diff line change @@ -1312,6 +1312,7 @@ object Parsers {
13121312
13131313 private def isFunction (tree : Tree ): Boolean = tree match {
13141314 case Parens (tree1) => isFunction(tree1)
1315+ case Block (Nil , tree1) => isFunction(tree1)
13151316 case _ : Function => true
13161317 case _ => false
13171318 }
Original file line number Diff line number Diff line change @@ -95,4 +95,6 @@ object Test extends App {
9595 // Parens handling
9696 val tt1 : [T ] => (T => T ) = [T ] => (x : T ) => x
9797 val tt2 : [T ] => T => T = [T ] => ((x : T ) => x)
98+ val tt3 : [T ] => T => T = [T ] => { (x : T ) => x }
99+ val tt4 : [T ] => T => T = [T ] => (x : T ) => { x }
98100}
You can’t perform that action at this time.
0 commit comments