struct A : _ExpressibleByBuiltinIntegerLiteral {
init() {}
init(_builtinIntegerLiteral value: _MaxBuiltinIntegerType) {}
}
struct B : ExpressibleByIntegerLiteral {
init(integerLiteral value: A) {}
}
B(integerLiteral: A())
Here is another example. Am I supposed to do that? Definitely not. Your lovely
question: Why not? Because the protocol starts with an underscore. So? Doesn’t
prevent me from abusing all semi-hidden protocols.
Where is the enum now to stop me from doing this?
Enums are so heavily abused in Swift, just because they have a special ability
not being extensible with a constructor.
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution