[SR-11014] Using a void return immediately before an @unknown default results in a compilation error #53404
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Environment
Swift 5.0, Xcode 10.2
Additional Detail from JIRA
md5: 7e8bfa15a3c43f075b068cb3bc6bda4e
duplicates:
Issue Description:
If the final case in a switch statement has a void return statement and you add an
@unknown default
statement after it, the compiler seems to interpret the default statement as being a continuation of the return. To fix the compiler, you need to explicitlyreturn ()
.Sample code exhibiting the issue:
The text was updated successfully, but these errors were encountered: