enum X {
case x(((((Int, String)))))
}
is the same as
enum X {
case x(Int, String)
}
except when creating a X:
let a = X.x((123, "ABC"))
vs.
let a = X.x(123, "ABC")
Other than this, both case behave the same elsewhere (switch/case let, if case let, guard case let). Since Swift don't allow single element tuple, ((T)) is same as T. Shouldn't the compile be consistent and make both the same? So both use:
let a = X.x(123, "ABC")
So that a typealias can be used to define the enum associate value?
typealias G = (Int, String)
enum X {
case x(G)
}
It appears the compiler is special case treating single element tuple expression as just the type, so should enum associated value be the same?