You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Sema] In simplifyType, if substitution fails retry with IUOs stripped. (#7196)
We can end up with IUOs bound as a result of overload resolution. When
this happens and the resulting type is used as a generic, we can end up
with dependent member types that fail to simplify properly as a result
of failing to substitute due to the IUO getting in the way. In these
cases it should be completely safe to strip the IUO off and retry
substitution with the base type.
This isn't really an ideal fix by any means, and we need to revisit how
we handle bindings to make it more uniform, but for now I think this is
a reasonable path to move forward.
Fixes a source compatibility regression.
rdar://problem/29960575
(cherry picked from ecedb33 with edits
to handle conflicts between branches)
_ =anyDict["test"]!.bar() // expected-error {{value of type 'Any' has no member 'bar'}}
232
232
// expected-note@-1 {{cast 'Any' to 'AnyObject' or use 'as!' to force downcast to a more specific type to access members}}{{5-5=(}}{{21-21= as AnyObject)}}
233
+
234
+
// Test that overload resolution during constraint solving of values
235
+
// looked-up dynamically through AnyObject are treated as conforming
236
+
// to the protocols they are supposed to conform to.
0 commit comments