Skip to content

Commit

Permalink
Recommend type(of:) instead of .dynamicType
Browse files Browse the repository at this point in the history
  • Loading branch information
SlaunchaMan committed Sep 26, 2016
1 parent f70a2e0 commit 41a8227
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apinotes/ObjectiveC.apinotes
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Protocols:
- Selector: class
MethodKind: Instance
Availability: nonswift
AvailabilityMsg: use 'dynamicType' instead
AvailabilityMsg: use 'type(of:)' instead
- Selector: 'conformsToProtocol:'
MethodKind: Instance
Nullability:
Expand Down
4 changes: 2 additions & 2 deletions test/ClangModules/availability.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ func test_NSInvocation(_ x: NSInvocation, // expected-error {{'NSInvocat
z: NSMethodSignature) {} // expected-error {{'NSMethodSignature' is unavailable}}

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

func test_unavailable_app_extension() {
Expand Down

0 comments on commit 41a8227

Please sign in to comment.