Skip to content

Commit 7f030e0

Browse files
Adjusting some tests
1 parent cdefbb3 commit 7f030e0

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

test/ClangImporter/objc_failable_inits.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ func testString() throws {
1818
// Implicitly unwrapped optional
1919
let stringIUO = NSString(path: "blah")
2020
if stringIUO == nil { }
21-
_ = stringIUO as NSString?
21+
_ = stringIUO as NSString? // expected-warning {{casting expression to 'NSString?' doesn't change the type}} {{17-30=}}
2222
let _: NSString = NSString(path: "blah")
2323
}
2424

2525
func testHive() {
2626
let hiveIUO = Hive()
2727
if hiveIUO == nil { }
28-
_ = hiveIUO as Hive?
28+
_ = hiveIUO as Hive? // expected-warning {{casting expression to 'Hive?' doesn't change the type}} {{15-24=}}
2929
let _: Hive = Hive()
3030
}

test/Generics/generic_types.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,11 @@ var xarray : XArray = [1, 2, 3]
191191
// Type parameters can be referenced only via unqualified name lookup
192192
struct XParam<T> {
193193
func foo(_ x: T) {
194-
_ = x as T
194+
_ = x as T // expected-warning {{casting expression to 'T' doesn't change the type}} {{11-16}}
195195
}
196196

197197
static func bar(_ x: T) {
198-
_ = x as T
198+
_ = x as T // expected-warning {{casting expression to 'T' doesn't change the type}} {{11-16}}
199199
}
200200
}
201201

test/decl/protocol/req/optional.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func optionalPropertyGeneric<T : P1>(_ t: T) {
144144

145145
// ... and that we can use it
146146
let i = propertyRef!
147-
_ = i as Int
147+
_ = i as Int // expected-warning {{casting expression to 'Int' doesn't change the type}} {{9-16=}}
148148
}
149149

150150
// Optional subscript references in generics.
@@ -157,7 +157,7 @@ func optionalSubscriptGeneric<T : P1>(_ t: T) {
157157

158158
// ... and that we can use it
159159
let i = subscriptRef!
160-
_ = i as ObjCClass?
160+
_ = i as ObjCClass? // expected-warning {{casting expression to 'ObjCClass?' doesn't change the type}} {{9-23=}}
161161
}
162162

163163
// Optional method references in existentials.
@@ -182,7 +182,7 @@ func optionalPropertyExistential(_ t: P1) {
182182

183183
// ... and that we can use it
184184
let i = propertyRef!
185-
_ = i as Int
185+
_ = i as Int // expected-warning {{casting expression to 'Int' doesn't change the type}} {{9-16=}}
186186
}
187187

188188
// Optional subscript references in existentials.
@@ -195,7 +195,7 @@ func optionalSubscriptExistential(_ t: P1) {
195195

196196
// ... and that we can use it
197197
let i = subscriptRef!
198-
_ = i as ObjCClass?
198+
_ = i as ObjCClass? // expected-warning {{casting expression to 'ObjCClass?' doesn't change the type}} {{9-23=}}
199199
}
200200

201201
// -----------------------------------------------------------------------

test/stdlib/StringDiagnostics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func testNonAmbiguousStringComparisons() {
2727
let s2 = "b"
2828
var x = false // expected-warning {{variable 'x' was written to, but never read}}
2929
x = s1 > s2
30-
x = s1 as String > s2
30+
x = s1 as String > s2 // expected-warning {{casting expression to 'String' doesn't change the type}} {{10-20=}}
3131
}
3232

3333
func testAmbiguousStringComparisons(s: String) {

0 commit comments

Comments
 (0)