I have been digging into the Swift library to solve the case where enum could 
have a RawValue of tuples of literals. So far, I found that in 
lib/Sema/TypeCheckDecl.cpp::3020 we do check the enum RawValue if it conforms 
to a knownProtocolKind, and if true, we switch over to check whether it’s 
ExpressibleByXXLiteral (XX could be String, Integer, etc..).
Now, my questions are:
I need to extend this condition to have a tuple of types that conforms to the 
knownProtocolKind, and I’m not quite sure where to start. (Note: It’s better to 
make the tuple conforms to a protocol type that is knownProtocolKind, so the 
enum can be tuple of tuples.., let me know your thoughts please).
We increment the RawValue if it’s of type Integer. What if the tuple of type 
(Int, String), will we need to increment the Int part as well? I think yes, but 
I’m asking to listen to your thoughts, too.


- Mohammed
_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev

Reply via email to