glideapps/quicktype

Swift 5.9 warning about Hashable being deprecated

Closed

#2.423 geöffnet am 11. Okt. 2023

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (968 Forks)batch import
Swiftgood first issue

Repository-Metriken

Stars
 (10.867 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Generate swift code has compilation warning about deprecated protocol.

SamSchema.swift:5645:16: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'JSONNull' to 'Hashable' by implementing 'hash(into:)' instead
    public var hashValue: Int {

Using :

swift --version 
swift-driver version: 1.87.1 Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
Target: arm64-apple-macosx14.0

Steps to reproduce :

curl -o sam.schema.json https://raw.githubusercontent.com/aws/serverless-application-model/develop/schema_source/sam.schema.json

quicktype -s schema sam.schema.json -o SamSchema.swift

swift SamSchema.swift 
SamSchema.swift:5645:16: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'JSONNull' to 'Hashable' by implementing 'hash(into:)' instead
    public var hashValue: Int {

Expected behaviour : generated code is updated to not include deprecated features.

Thanks !

Contributor Guide