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
If to use optional associated values and matching to nil without label there will not be warnings or errors, but result will be unpredictable for programmer:
enumEnum{case value(b:Bool?)case value(s:String?)}func check(_ e:Enum){
switch e {case.value(nil):print("\(e): associated value is nil")default:print("\(e): associated value is not nil")}}check(.value(s:nil))// printed: value(s: nil): associated value is nilcheck(.value(b:nil))// printed: value(b: nil): associated value is not nil
Tested in XCode 12.0.1 with default keychain. For development snapshot 2020-09-23 will be assertion failure "ambiguity in enum case name lookup?!"
Additional Detail from JIRA
md5: 350d59c094ebd69b46ed0ffb8988f306
Parent-Task:
is blocked by:
duplicates:
Issue Description:
This crashes the compiler in an assertions-enabled build:
Without assertions enabled, it emits a bogus diagnostic:
The same assertion trips if you try to match only on pattern binding name:
or if the cases differ in arity, not only in label names:
The text was updated successfully, but these errors were encountered: