-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
swiftlang/swift-syntax
#2825Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.triage neededThis issue needs more specific labelsThis issue needs more specific labels
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
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.triage neededThis issue needs more specific labelsThis issue needs more specific labels