Skip to content

'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'JSONNull' to 'Hashable' by implementing 'hash(into:)' instead #1698

Description

@tciuro

The current hash helper looks like this:

public class JSONNull: Codable, Hashable {

    ...

    public var hashValue: Int {
        return 0
    }

    ...
}

It should be updated with this:

public class JSONNull: Codable, Hashable {

    ...

    public func hash(into hasher: inout Hasher) {
        hasher.combine(0)
    }

    ...
}

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions