-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests fail to build with Xcode 15.3 #342
Comments
I'm not sure why but in this version of XCode the compiler is not able to infer the type compare to the previous versions. For instance in We can add more type information on the JSONObject Parser: //Before
struct JSONObject: ParserPrinter {
var body: some ParserPrinter<Substring.UTF8View, [String: JSONValue.Output]> {
"{".utf8
Many(into: [String: JSONValue.Output]()) { object, pair in
let (name, value) = pair
object[name] = value
} decumulator: { object in
(object.sorted(by: { $0.key < $1.key }) as [(String, JSONValue.Output)])
.reversed()
.makeIterator()
} element: {
Whitespace()
JSONString()
Whitespace()
":".utf8
JSONValue()
} separator: {
",".utf8
} terminator: {
"}".utf8
}
}
}
// After
struct JSONObject: ParserPrinter {
var body: some ParserPrinter<Substring.UTF8View, [String: JSONValue.Output]> {
"{".utf8
Many(into: [String: JSONValue.Output]()) { (
object: inout [String: JSONValue.Output],
pair: (String, JSONValue.Output)
) in
let (name, value) = pair
object[name] = value
} decumulator: { object in
(object.sorted(by: { $0.key < $1.key }) as [(String, JSONValue.Output)])
.reversed()
.makeIterator()
} element: {
Whitespace()
JSONString()
Whitespace()
":".utf8
JSONValue()
} separator: {
",".utf8
} terminator: {
"}".utf8
}
}
} I have submitted a pull request for this. |
Thanks. I wondered it was an issue with the compiler not being able to infer types. I used to see that error years ago with Swift but haven't seen it recently. @cham-s thanks for submitting a pull request. |
I assume these tests built before but with Xcode 15.3, the Swift compiler fails with compiler issues:
swift-parsing/Sources/swift-parsing-benchmark/JSON.swift:71:84 Failed to produce diagnostic for expression; please submit a bug report (https://swift.org/contributing/#reporting-bugs)
swift-parsing/Tests/ParsingTests/OneOfTests.swift:272:86 Failed to produce diagnostic for expression; please submit a bug report (https://swift.org/contributing/#reporting-bugs)
I did not file a bug at swift.org as I didn't feel I could narrow it down.
The text was updated successfully, but these errors were encountered: