I've found a strange behaviour that I can't understand.
An object of the SaveGame type serializes without trouble, and I can save it to and properly deserialize it from a file:
but expected one of:
proc `*`[T](x, y: set[T]): set[T]
first type mismatch at position: 1
required type: set[T]
but expression 'len(obj274023.sectors)' is of type: int
proc `*`(x, y: int32): int32
first type mismatch at position: 1
required type: int32
but expression 'len(obj274023.sectors)' is of type: int
proc `*`(x, y: float): float
first type mismatch at position: 1
required type: float
but expression 'len(obj274023.sectors)' is of type: int
proc `*`(x, y: int16): int16
first type mismatch at position: 1
required type: int16
but expression 'len(obj274023.sectors)' is of type: int
proc `*`(x, y: int): int
first type mismatch at position: 2
required type: int
but expression '
result += 1
result += 0' is of type: void
proc `*`(x, y: int64): int64
first type mismatch at position: 2
required type: int64
but expression '
result += 1
result += 0' is of type: void
proc `*`[T: SomeUnsignedInt](x, y: T): T
first type mismatch at position: 1
required type: T: SomeUnsignedInt
but expression 'len(obj274023.sectors)' is of type: int
proc `*`(x, y: float32): float32
first type mismatch at position: 1
required type: float32
but expression 'len(obj274023.sectors)' is of type: int
proc `*`(x, y: int8): int8
first type mismatch at position: 1
required type: int8
but expression 'len(obj274023.sectors)' is of type: int
expression: len(obj274023.sectors) *
result += 1
result += 0
Basically, it seems like SavedSector has to have a string field for some reason, but I don't understand why that would be.