Optional setters for non-optional values

I would find the opposite case more useful in my code:

subscript[key: FieldKey] -> FieldValue? {
    get {
        storageDictionary[key]
    }
    non-optional set {
        storageDictionary[key] = newValue
    }
}

so perhaps all combinations should be made available.

1 Like