mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Unfortunately current approach of making a conversion independent of location doesn't work when conversion is required for multiple arguments to the same call because solver expects that either there are no Double<->CGFloat conversions, or one of them has already been applied which is not the case. The reason why locations weren't preserved in the first place is due to how a solution is applied to AST - AST is mutated first and then, if there are any conversions, they are applied to the already mutated version of original AST. This creates a problem for Double<->CGFloat which depends on an overload choice of injected call and it's impossible to find it based on the mutated AST. But it turns out that this is only an issue in two specific cases - conversions against contextual type and after optional injection. This situations could be mitigated by dropping parts of the locator which are unimportant for the Double<->CGFloat conversion - anchor in case of contextual and `OptionalPayload` element(s) in case of optional injection. Resolves: https://github.com/apple/swift/issues/59374
523 KiB
523 KiB