A file reference with a negative encoding traps instead of throwing:
let json = #"{"default-configuration":"Debug","localizations":{"development":"en"},"files":[{"path":"a.txt","encoding":-1}]}"#
_ = try XCSchema.Project(jsonRepresentation: Data(json.utf8))
// Fatal error: Negative value is not representable
xcprojformatter dies the same way (exit 133).
It's UInt(Int(with: coder)) in String.Encoding+JSONCodable.swift:107. Values above Int.max (e.g. 9223372036854775808) crash too, because NSNumber.intValue in Value.swift:94 wraps them negative. UInt(exactly:) plus a thrown error would fix it.
main @ c132630, macOS 26, Swift 6.3.3
A file reference with a negative
encodingtraps instead of throwing:xcprojformatterdies the same way (exit 133).It's
UInt(Int(with: coder))inString.Encoding+JSONCodable.swift:107. Values aboveInt.max(e.g.9223372036854775808) crash too, becauseNSNumber.intValueinValue.swift:94wraps them negative.UInt(exactly:)plus a thrown error would fix it.main @ c132630, macOS 26, Swift 6.3.3