Skip to content

Commit 41a8227

Browse files
committed
Recommend type(of:) instead of .dynamicType
1 parent f70a2e0 commit 41a8227

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

apinotes/ObjectiveC.apinotes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Protocols:
101101
- Selector: class
102102
MethodKind: Instance
103103
Availability: nonswift
104-
AvailabilityMsg: use 'dynamicType' instead
104+
AvailabilityMsg: use 'type(of:)' instead
105105
- Selector: 'conformsToProtocol:'
106106
MethodKind: Instance
107107
Nullability:

test/ClangModules/availability.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ func test_NSInvocation(_ x: NSInvocation, // expected-error {{'NSInvocat
3434
z: NSMethodSignature) {} // expected-error {{'NSMethodSignature' is unavailable}}
3535

3636
func test_class_avail(_ x:NSObject, obj: AnyObject) {
37-
x.`class`() // expected-error {{'class()' is unavailable in Swift: use 'dynamicType' instead}} expected-warning {{result of call to 'class()' is unused}}
37+
x.`class`() // expected-error {{'class()' is unavailable in Swift: use 'type(of:)' instead}} expected-warning {{result of call to 'class()' is unused}}
3838
_ = NSObject.`class`() // expected-error {{'class()' is unavailable in Swift: use 'self' instead}}
39-
_ = obj.`class`!() // expected-error {{'class()' is unavailable in Swift: use 'dynamicType' instead}}
39+
_ = obj.`class`!() // expected-error {{'class()' is unavailable in Swift: use 'type(of:)' instead}}
4040
}
4141

4242
func test_unavailable_app_extension() {

0 commit comments

Comments
 (0)