-
Notifications
You must be signed in to change notification settings - Fork 254
Closed
Labels
Description
| Previous ID | SR-15305 |
| Radar | None |
| Original Reporter | @klanchman |
| Type | Bug |
Environment
-
macOS 11.6 (20G165)
-
swift-format 0.50500.0, release configuration
Additional Detail from JIRA
| Votes | 0 |
| Component/s | swift-format |
| Labels | Bug |
| Assignee | None |
| Priority | Medium |
md5: 06f5c44e7c1b5b10eb313c28ce66331b
Issue Description:
When using swift-format in release configuration with default settings, using postfix #if expressions causes swift-format to remove a necessary newline.
Using the code from the evolution proposal, swift-format lint outputs a warning:
VStack {
Text("something") <<< (swift-format) warning: [RemoveLine]: remove line break
#if os(iOS)
.iOSSpecificModifier()
#endif
.commonModifier()
}Formatting results in code that causes a compiler error:
VStack {
Text("something")#if os(iOS) <<< (Swift) error: Consecutive statements on a line must be separated by a newline
.iOSSpecificModifier()
#endif
.commonModifier()
}