A wrapped line inside a \(…) interpolation is not re-indented to the
multi-line string's indentation, so it ends up less-indented than the closing
""", producing source that no longer compiles.
Input
func test() {
view {
Button("Hi") {}
.label(
"""
\(name: Color(
.sRGBLinear, red: 1.0, green: 0.6, blue: 0.0))
""")
.id("button")
}
}
Output (invalid)
Button("Hi") {}.label(
"""
\(name: Color(
.sRGBLinear, red: 1.0, green: 0.6, blue: 0.0))
"""
).id("button")
error: insufficient indentation of line in multi-line string literal — the
.sRGBLinear line (col 4) is less indented than the closing """ (col 6).
A wrapped line inside a
\(…)interpolation is not re-indented to themulti-line string's indentation, so it ends up less-indented than the closing
""", producing source that no longer compiles.Input
Output (invalid)
error: insufficient indentation of line in multi-line string literal— the.sRGBLinearline (col 4) is less indented than the closing"""(col 6).