As soon as you start dealing with nested optionals, Swift definitely has some ergonomic issues. However, this is a deliberate tradeoff—nested optionals are exceedingly rare, and single optionals are widely used. It's reasonable for Swift to optimize for a single level of optionality at the expense of nested optionals.
I describe the issues with nested optionals as "ergonomic" because there's nothing that prohibits you from working with them. Swift APIs will happily traffic in nested optionals, and there's circumstances where a double optional makes perfect sense as a way to model a problem (like, say, distinguishing between "unset" and "set to nil" states, as in your first post in this thread).
However, due to the potential for confusion between the different possible levels of optionality, I would pretty much always push back against any proposed API design which made use of nested optionals. It will save you many headaches to more explicitly model your relationships from the start, e.g., by creating an enum
enum PropertyState {
case unset
case set(Int?)
}
For better or for worse, this is simply the wrong way to think about literals in Swift. Again, it works well enough for a single level of optionality, but breaks down as soon as you have nested optionals. If you're dealing with different types, nil means something different. It's the same as this:
let x: Float = 16777217
let y: Int = 16777217
print(Int(x) == y) // false!
You could say "Developers expect that 16777217 means 16777217," but that's clearly ridiculous in this example. The literal 16777217 only "means" anything in the context of a particular type, and in the context of Float, 16777217 "means" the same thing as 16777216.0.
I question the premise that this is a valuable end. There are likely better ways to achieve your goals.
Ah, but if you have a variable x of some unconstrained generic type T, it is the case that x always has a value of type T. Effectively, you may assume that T is not optional, because that's not your concern as the author of a generic function. Clients may pass in an optional type, and your generic code will treat it the same as any other type.
ETA: IMO, if this remains confusing for you, your best bet is probably to avoid nil in situations where you are dealing with nested optionals. Write out Int??.none or Int??.some(Int?.none) explicitly to make it clear what values you're trying to represent.