Description
Description
the code in the snippet raises error: new Swift parser generated errors for code that C++ parser accepted
, but only on toolchains with assertions enabled (swift-5.10.1-RELEASE-ubuntu24.04
).
for some reason, i could not locate a 6.0 or main branch toolchain for Ubuntu 24.04 on https://www.swift.org/download/ so i was not able to test those versions.
crash2.swift:6:6: error: consecutive statements on a line must be separated by newline or ';'
} (&y[0])
^
crash2.swift:6:6: note: insert newline
} (&y[0])
^
crash2.swift:6:6: note: insert ';'
} (&y[0])
^
;
crash2.swift:1:1: error: new Swift parser generated errors for code that C++ parser accepted
func f(x:[Void])
^
error: fatalError
Reproduction
func f(x:[Void])
{
var y:[[Void]] = x.map { [$0] }
{
$0.reserveCapacity(1)
} (&y[0])
}
Expected behavior
?
Environment
Swift version 5.10.1 (swift-5.10.1-RELEASE)
Target: x86_64-unknown-linux-gnu
Additional information
No response