Protocol Conformance for Tuples / Anonymous Structs

at some point we’re going to want to make the literal protocols completely lexical, as described here, and that will require overloaded literal-inits if we want to get all the mileage out of that feature, so i don’t see why @tupleLiteral can’t piggyback on that when it comes time.

// invokes Double.init(sign: .plus, base: .decimal, digits:[9, 8, 9, 1])
let x:Double = 1989

// invokes Double.init(sign: .plus, base: .hexadecimal, 
//                 fraction: [10], digits:[1, 15], exponent: [2, 1])
let y:Double = 0xF1.Ap12

no reason why classes or enums should get left out, im just using structs as an example.

1 Like