Commits

Joe Pamer committed 7245e408252
The type checker collects all overloads for a given function application during the pre-type check phase, but equality conformances (and their associated '==' overloads) may be added to a type lazily during type resolution. This can lead to inconsistent behavior during type checking equality comparisons on imported enumeration types. (rdar://problem/16526249) Basically, if an imported enumeration case is referenced without qualification as an argument to a '==' application (E.g., "foo.bar == .Baz"), and the enumeration type had not previously been resolved, overloads to '==' will be added to the global scope while performing overload resolution. This means the overloads will be ignored while solving for that application, but will be available for subsequent applications. (So you'll get an "expression does not type check" error the first time around, but not for subsequent applications of '==' to that enumeration type.) The Equatable protocol is rather lightweight, however, and adding it to imported types directly results in no meaningful overhead to type check performance; we should just add it outright. As things evolve, though, it'll be worth considering how to make the type checker more amenable to lazy declarations. Swift SVN r16557