Skip to content

Commit 762ebbf

Browse files
committed
Make { x => ... } count as "isFunctionWithUnknownParamType"
Failed before because of the outer block. This fixes #2867.
1 parent 5e05d3f commit 762ebbf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/src/dotty/tools/dotc/ast/TreeInfo.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,14 +273,16 @@ trait UntypedTreeInfo extends TreeInfo[Untyped] { self: Trees.Instance[Untyped]
273273
case _ => false
274274
}
275275

276-
def isFunctionWithUnknownParamType(tree: Tree) = tree match {
276+
def isFunctionWithUnknownParamType(tree: Tree): Boolean = tree match {
277277
case Function(args, _) =>
278278
args.exists {
279279
case ValDef(_, tpt, _) => tpt.isEmpty
280280
case _ => false
281281
}
282282
case Match(EmptyTree, _) =>
283283
true
284+
case Block(Nil, expr) =>
285+
isFunctionWithUnknownParamType(expr)
284286
case _ => false
285287
}
286288

0 commit comments

Comments
 (0)