mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Don't suggest adding 'as' in a pattern matching context where it will do no good.
This commit is contained in:
@@ -53,6 +53,9 @@ func testAmbiguousStringComparisons(s: String) {
|
||||
let a10 = nsString <= s // expected-error{{'NSString' is not implicitly convertible to 'String'; did you mean to use 'as' to explicitly convert?}} {{21-21= as String}}
|
||||
let a11 = nsString >= s // expected-error{{'NSString' is not implicitly convertible to 'String'; did you mean to use 'as' to explicitly convert?}} {{21-21= as String}}
|
||||
let a12 = nsString > s // expected-error{{'NSString' is not implicitly convertible to 'String'; did you mean to use 'as' to explicitly convert?}} {{21-21= as String}}
|
||||
|
||||
// Shouldn't suggest 'as' in a pattern-matching context, as opposed to all these other situations
|
||||
if case nsString = "" {} // expected-error{{expression pattern of type 'NSString' cannot match values of type 'String'}}
|
||||
}
|
||||
|
||||
func testStringDeprecation(hello: String) {
|
||||
|
||||
Reference in New Issue
Block a user