Skip to content

Commit e1c0dec

Browse files
committed
Update some test cases for the OptionalSomePattern change.
1 parent be8b9e5 commit e1c0dec

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

test/IDE/complete_value_expr.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,8 +1982,8 @@ func testThrows006() {
19821982
19831983
// rdar://21346928
19841984
// Just sample some String API to sanity check.
1985-
// AUTOCLOSURE_STRING: Decl[InstanceVar]/CurrNominal: unicodeScalars[#String.UnicodeScalarView#]
1986-
// AUTOCLOSURE_STRING: Decl[InstanceVar]/CurrNominal: utf16[#String.UTF16View#]
1985+
// AUTOCLOSURE_STRING: Decl[InstanceVar]/CurrNominal{{.*}}: {{.*}}unicodeScalars[#String.UnicodeScalarView#]
1986+
// AUTOCLOSURE_STRING: Decl[InstanceVar]/CurrNominal{{.*}}: {{.*}}utf16[#String.UTF16View#]
19871987
func testWithAutoClosure1(_ x: String?) {
19881988
(x ?? "autoclosure").#^AUTOCLOSURE1^#
19891989
}

test/Misc/misc_diagnostics.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ import CoreGraphics
88
var roomName : String?
99

1010
if let realRoomName = roomName as! NSString { // expected-warning{{forced cast from 'String?' to 'NSString' only unwraps and bridges; did you mean to use '!' with 'as'?}}
11-
// expected-error@-1{{initializer for conditional binding must have Optional type, not 'NSString'}}
12-
11+
// expected-error@-1{{initializer for conditional binding must have Optional type, not 'NSString'}}
12+
// expected-warning@-2{{treating a forced downcast to 'NSString' as optional will never produce 'nil'}}
13+
// expected-note@-3{{add parentheses around the cast to silence this warning}}
14+
// expected-note@-4{{use 'as?' to perform a conditional downcast to 'NSString'}}
15+
_ = realRoomName
1316
}
1417

1518
var pi = 3.14159265358979

0 commit comments

Comments
 (0)