There's no way to prevent it today, but maybe when Swift supports macros or constant expressions.
I have seen many users do:
static let interval = Key<Double?>("interval", default: nil)
The default
parameter is moot in this case.
Or even worse:
static let interval = Key<Double?>("interval", default: 4)
Which has the incorrect behavior by never allowing the value to be set to nil
. (The correct solution to this is #54)
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too