Skip to content

Commit e717571

Browse files
authored
Merge pull request #4974 from SlaunchaMan/SR-2747
SR-2747: Recommend type(of:) instead of .dynamicType
2 parents 4cf424e + 41a8227 commit e717571

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: apinotes/ObjectiveC.apinotes

+1-1
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:

Diff for: test/ClangModules/availability.swift

+2-2
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)