mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This makes us more lenient about what we accept for Objective-C selectors by allowing you to include or not include the trailing colons. We don't actually need that information, because we have access to the declaration, so it was only being used for validation, which made the API harder to use for clients that didn't carefully track zero vs one-arg selector names. Also remove the colons from the response, and instead add a bit to say whether it is a zero-arg or one-arg selector. This makes the response easier to use for clients that don't care about this information, and more consistent with the change to the input. rdar://problem/32177934
18 lines
1.1 KiB
Swift
18 lines
1.1 KiB
Swift
import Foo
|
|
|
|
func foo2 () {
|
|
_ = FooClassBase(float: 2.3)
|
|
_ = FooClassBase(float: 2.3, second: 2)
|
|
}
|
|
|
|
// REQUIRES: objc_interop
|
|
// RUN: %sourcekitd-test -req=translate -objc-selector initWithFloat2: -pos=4:15 %s -- -F %S/Inputs/mock-sdk -I %t.tmp %mcp_opt %s | %FileCheck -check-prefix=CHECK1 %s
|
|
// RUN: %sourcekitd-test -req=translate -objc-selector initWithFloat2 -pos=4:15 %s -- -F %S/Inputs/mock-sdk -I %t.tmp %mcp_opt %s | %FileCheck -check-prefix=CHECK1 %s
|
|
// RUN: %sourcekitd-test -req=translate -objc-selector initWithFloat2:second2: -pos=5:15 %s -- -F %S/Inputs/mock-sdk -I %t.tmp %mcp_opt %s | %FileCheck -check-prefix=CHECK2 %s
|
|
// RUN: %sourcekitd-test -req=translate -objc-selector initWithFloat2:second2:third: -pos=5:15 %s -- -F %S/Inputs/mock-sdk -I %t.tmp %mcp_opt %s | %FileCheck -check-prefix=CHECK-NONE %s
|
|
// RUN: %sourcekitd-test -req=translate -objc-selector initFloat2:second2: -pos=5:15 %s -- -F %S/Inputs/mock-sdk -I %t.tmp %mcp_opt %s | %FileCheck -check-prefix=CHECK2 %s
|
|
|
|
// CHECK-NONE: <empty name translation info>
|
|
// CHECK1: init(float2:)
|
|
// CHECK2: init(float2:second2:)
|