File tree 3 files changed +5
-0
lines changed
compiler/src/dotty/tools/dotc
3 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -1611,6 +1611,8 @@ object desugar {
1611
1611
def makePolyFunction (targs : List [Tree ], body : Tree ): Tree = body match {
1612
1612
case Parens (body1) =>
1613
1613
makePolyFunction(targs, body1)
1614
+ case Block (Nil , body1) =>
1615
+ makePolyFunction(targs, body1)
1614
1616
case Function (vargs, res) =>
1615
1617
assert(targs.nonEmpty)
1616
1618
// 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 {
1312
1312
1313
1313
private def isFunction (tree : Tree ): Boolean = tree match {
1314
1314
case Parens (tree1) => isFunction(tree1)
1315
+ case Block (Nil , tree1) => isFunction(tree1)
1315
1316
case _ : Function => true
1316
1317
case _ => false
1317
1318
}
Original file line number Diff line number Diff line change @@ -95,4 +95,6 @@ object Test extends App {
95
95
// Parens handling
96
96
val tt1 : [T ] => (T => T ) = [T ] => (x : T ) => x
97
97
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 }
98
100
}
You can’t perform that action at this time.
0 commit comments