A string with a single interpolation is not inferred as ExpressibleByStringInterpolation
marcprux opened this issue · comments
Marc Prud'hommeaux commented
The string "A\(x)Z"
can be used as an ExpressibleByStringInterpolation
, but the string with just a single interpolation like "\(x)"
cannot.
See the test case at skiptools/skip-lib@f1d42cf
Two adjacent string interpolations:
XCTAssertEqual("stringstring", intepolate("\("string")\("string")"))
will be transpiled to the Kotlin:
XCTAssertEqual("stringstring", intepolate({
val str = StringExpressibleExample.StringInterpolationExample(literalCapacity = 0, interpolationCount = 0)
str.appendInterpolation("string")
str.appendInterpolation("string")
StringExpressibleExample(stringInterpolation = str)
}()))
But the single string interpolation:
XCTAssertEqual("string", intepolate("\("string")"))
does not handle interpolation:
XCTAssertEqual("string", intepolate("${"string"}"))
Marc Prud'hommeaux commented
Fixed by @aabewhite in 0.7.32 (0c2aa6b)