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: Fix crash with recursive subscript validation via associated type inference
Looks like subscript validation wasn't checking or setting
ValueDecl::isBeingValidated(). This caused a stack overflow
with associated type inference. The way to trigger this
during normal use is to invoke the fixit for adding
missing protocol requirements -- they're written in terms
of the protocol's associated type, which the user might
not have defined yet.
Fixes <rdar://problem/26680599>.
structXSubP0b:SubscriptP0{ // expected-error{{type 'XSubP0b' does not conform to protocol 'SubscriptP0'}}
145
+
structXSubP0b:SubscriptP0{
146
+
// expected-error@-1{{type 'XSubP0b' does not conform to protocol 'SubscriptP0'}}
142
147
subscript (i:Int)->Float{get{returnFloat(i)}} // expected-note{{inferred type 'Float' (by matching requirement 'subscript') is invalid: does not conform to 'PSimple'}}
143
148
}
144
149
150
+
structXSubP0c:SubscriptP0{
151
+
// expected-error@-1 {{type 'XSubP0c' does not conform to protocol 'SubscriptP0'}}
152
+
subscript (i:Index)->Element{get{}}
153
+
}
154
+
155
+
structXSubP0d:SubscriptP0{
156
+
// expected-error@-1 {{type 'XSubP0d' does not conform to protocol 'SubscriptP0'}}
0 commit comments