Skip to content

Commit c29fbb5

Browse files
[test] Adjusting test files where class syntax is used for protocol inheritance
1 parent e3373a9 commit c29fbb5

File tree

9 files changed

+10
-10
lines changed

9 files changed

+10
-10
lines changed

test/Parse/try_swift5.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ let _: Int??? = try? producer.produceDoubleOptionalInt() // good
263263
let _: String = try? producer.produceDoubleOptionalInt() // expected-error {{cannot convert value of type 'Int??' to specified type 'String'}}
264264

265265
// rdar://problem/46742002
266-
protocol Dummy : class {}
266+
protocol Dummy : AnyObject {}
267267

268268
class F<T> {
269269
func wait() throws -> T { fatalError() }

test/decl/func/dynamic_self.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ extension P0 {
4444
}
4545
}
4646

47-
protocol P1: class {
47+
protocol P1: AnyObject {
4848
func f() -> Self // okay
4949

5050
func g(_ ds: Self) // okay

test/stdlib/Builtins.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ tests.test("array value witnesses") {
165165
expectEqual(NoisyLifeCount, NoisyDeathCount)
166166
}
167167

168-
protocol Classy : class {}
168+
protocol Classy : AnyObject {}
169169
class A : Classy {}
170170
class B : A {}
171171
class C : B {}

test/stdlib/Error.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ protocol OtherProtocol {
1515
var otherProperty: String { get }
1616
}
1717

18-
protocol OtherClassProtocol : class {
18+
protocol OtherClassProtocol : AnyObject {
1919
var otherClassProperty: String { get }
2020
}
2121

test/stdlib/ErrorBridged.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ protocol OtherProtocol {
2222
var otherProperty: String { get }
2323
}
2424

25-
protocol OtherClassProtocol : class {
25+
protocol OtherClassProtocol : AnyObject {
2626
var otherClassProperty: String { get }
2727
}
2828

test/stdlib/Mirror.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ mirrors.test("struct/WrapNSArray") {
514514
// Check that Mirror correctly reflects weak/unowned refs to both
515515
// Swift and ObjC objects from Swift structs and classes.
516516

517-
protocol WeakUnownedTestsP1: class {
517+
protocol WeakUnownedTestsP1: AnyObject {
518518
func f1() -> Int
519519
}
520520

test/stdlib/Reflection.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ print("Fooable double:")
118118
fooable = 2.5
119119
dump(fooable)
120120

121-
protocol Barrable : class {}
121+
protocol Barrable : AnyObject {}
122122
extension Best: Barrable {}
123123

124124
// CHECK-LABEL: Barrable class:

test/stdlib/Runtime.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ Runtime.test("abstraction barrier on casting generic param bound to existential"
534534
class Malkovich: Malkovichable {
535535
var malkovich: String { return "malkovich" }
536536
}
537-
protocol Malkovichable: class {
537+
protocol Malkovichable: AnyObject {
538538
var malkovich: String { get }
539539
}
540540

test/stdlib/WeakMirror.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class NativeSwiftClass : NativeClassBoundExistential {
3535
}
3636
}
3737

38-
protocol NativeClassBoundExistential : class {
38+
protocol NativeClassBoundExistential : AnyObject {
3939
var x: Int { get }
4040
}
4141
class NativeSwiftClassHasWeak {
@@ -123,7 +123,7 @@ mirrors.test("class/NativeSwiftClassHasNativeWeakReferenceNoLeak") {
123123

124124
import Foundation
125125

126-
@objc protocol ObjCClassExistential : class {
126+
@objc protocol ObjCClassExistential : AnyObject {
127127
var weakProperty: AnyObject? { get set }
128128
var x: Int { get }
129129
}

0 commit comments

Comments
 (0)