Details
Description
Reproducer which fail to parse:
func fun() -> () -> Int { { return 42 } }
which is equivalent to:
func fun() -> () -> Int { return { return 42 } }
From https://docs.swift.org/swift-book/LanguageGuide/Functions.html:
Functions With an Implicit Return
If the entire body of the function is a single expression, the function implicitly returns that expression.
This parsing error was caused by disambiguation introduced by SONARSWIFT-11, it should be safe to allow code blocks with single element being a closure expression.