Skip to content

Commit

Permalink
Notes on GlobalID being a class
Browse files Browse the repository at this point in the history
We should try to get rid of this.
  • Loading branch information
helje5 committed Nov 19, 2024
1 parent 5883a6f commit 0fbd359
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Sources/ZeeQL/Control/GlobalID.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,25 @@
// ZeeQL
//
// Created by Helge Hess on 17/02/17.
// Copyright © 2017-2019 ZeeZide GmbH. All rights reserved.
// Copyright © 2017-2024 ZeeZide GmbH. All rights reserved.
//

// FIXME(hh 2024-11-19): Those should not be classes!
// - see below
// - make GlobalID a protocol
// - and the specific ones structs
// Should not break anything, they are immutable? Or not, for the temporary
// ID?
// - maybe we could just makes this an enum? no one is going to invent own
// additional GIDs?

open class GlobalID : EquatableType, Hashable {
// Note: cannot be a protocol because Hashable (because Equatable)
// hh(2024-11-19):
// Explanation: This is often used as a key. And Equality does NOT depend on
// the type, e.g. a `ComplexKeyGlobalID<[Int]>` can match
// `SingleIntKeyGlobalID`
// - In modern Swift it can? Even in old using AnyHashable?

public init() {}

Expand Down

0 comments on commit 0fbd359

Please sign in to comment.