forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recognize imported enum case aliases in TypeCheckPattern.cpp.
...so that they can still be used with exhaustive switches. This is a hack---groveling through the AST to see if it's in the particular form of an imported enum case alias---but at least it's limited to imported properties. More rdar://problem/18662118 Swift SVN r28326
- Loading branch information
1 parent
21b8312
commit 46b5257
Showing
6 changed files
with
173 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-sil %s -verify | ||
|
||
// REQUIRES: objc_interop | ||
|
||
import Foundation | ||
import user_objc | ||
|
||
let aliasOriginal = NSAliasesEnum.ByName | ||
|
||
switch aliasOriginal { | ||
case .Original: | ||
break | ||
} // expected-error {{switch must be exhaustive, consider adding a default clause}} | ||
|
||
switch aliasOriginal { | ||
case .BySameValue: | ||
break | ||
} // expected-error {{switch must be exhaustive, consider adding a default clause}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters