mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Rather than synthesizing a global operator '==' for Equatable enums, synthesize a member operator, which is more idiomatic and much cleaner. To make sure that these synthesized operators can actually be found, start considering operator requirements in protocols more generally in the type checker, so that, e.g., "myEnum == myEnum" will type-check against Equatable.== and, on successful type-check, will call the (newly-synthesized) witness for '=='. This both makes it easier to make sure we find the operators in, e.g., complex multi-file and lazy-type checking scenarios, and is a step toward the type-checking improvements described in SE-0091.
62 KiB
62 KiB