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 failure to emit diagnostic with some invalid member type references
There were two problems here:
- isUnsupportedMemberTypeReference() checked if the immediate parent type was
an unbound generic type, but did not check for the parent of the parent, etc.
- The caller of isUnsupportedMemberTypeReference() had to re-check the
various invalid conditions to determine what diagnostic to emit, and if
none of those conditions matched it would just return an ErrorType without
emitting a diagnostic.
Fix both of these by having isUnsupportedMemberTypeReference() return an
enum indicating what went wrong, and handle more cases.
Fixes <rdar://problem/67292528>.
enumEnumWithInheritance1:FooNonExistentProtocol{} // expected-error {{cannot find type 'FooNonExistentProtocol' in scope}} expected-error {{raw type}} expected-error {{an enum with no cases}}
112
+
enumEnumWithInheritance1:FooNonExistentProtocol{} // expected-error {{cannot find type 'FooNonExistentProtocol' in scope}} expected-error {{an enum with no cases}}
enumEnumWithInheritance2:FooNonExistentProtocol,BarNonExistentProtocol{} // expected-error {{cannot find type 'FooNonExistentProtocol' in scope}} expected-error {{cannot find type 'BarNonExistentProtocol' in scope}} expected-error {{raw type}} expected-error {{an enum with no cases}}
116
+
enumEnumWithInheritance2:FooNonExistentProtocol,BarNonExistentProtocol{} // expected-error {{cannot find type 'FooNonExistentProtocol' in scope}} expected-error {{cannot find type 'BarNonExistentProtocol' in scope}} expected-error {{an enum with no cases}}
0 commit comments