2
2
3
3
// RUN: %target-swift-frontend %s -swift-version 5 -module-name main -disable-availability-checking -typecheck -plugin-path %swift-plugin-dir -dump-macro-expansions -enable-experimental-feature Span -enable-experimental-feature LifetimeDependence 2>&1 | %FileCheck --match-full-lines %s
4
4
5
- @_SwiftifyImportProtocol ( . method( name : " func myFunc(_ ptr: UnsafePointer<CInt>, _ len: CInt) " , paramInfo: [ . countedBy( pointer: . param( 1 ) , count: " len " ) ] ) )
5
+ @_SwiftifyImportProtocol ( . method( signature : " func myFunc(_ ptr: UnsafePointer<CInt>, _ len: CInt) " , paramInfo: [ . countedBy( pointer: . param( 1 ) , count: " len " ) ] ) )
6
6
protocol SimpleProtocol {
7
7
func myFunc( _ ptr: UnsafePointer < CInt > , _ len: CInt )
8
8
}
@@ -14,8 +14,8 @@ protocol SimpleProtocol {
14
14
// CHECK-NEXT: }
15
15
// CHECK-NEXT: }
16
16
17
- @_SwiftifyImportProtocol ( . method( name : " func foo(_ ptr: UnsafePointer<CInt>, _ len: CInt) " , paramInfo: [ . countedBy( pointer: . param( 1 ) , count: " len " ) , . nonescaping( pointer: . param( 1 ) ) ] ) ,
18
- . method( name : " func bar(_ len: CInt) -> UnsafePointer<CInt> " , paramInfo: [ . countedBy( pointer: . return, count: " len " ) , . nonescaping( pointer: . return) , . lifetimeDependence( dependsOn: . self , pointer: . return, type: . borrow) ] ) )
17
+ @_SwiftifyImportProtocol ( . method( signature : " func foo(_ ptr: UnsafePointer<CInt>, _ len: CInt) " , paramInfo: [ . countedBy( pointer: . param( 1 ) , count: " len " ) , . nonescaping( pointer: . param( 1 ) ) ] ) ,
18
+ . method( signature : " func bar(_ len: CInt) -> UnsafePointer<CInt> " , paramInfo: [ . countedBy( pointer: . return, count: " len " ) , . nonescaping( pointer: . return) , . lifetimeDependence( dependsOn: . self , pointer: . return, type: . borrow) ] ) )
19
19
protocol SpanProtocol {
20
20
func foo( _ ptr: UnsafePointer < CInt > , _ len: CInt )
21
21
func bar( _ len: CInt ) -> UnsafePointer < CInt >
@@ -35,8 +35,8 @@ protocol SpanProtocol {
35
35
// CHECK-NEXT: }
36
36
// CHECK-NEXT: }
37
37
38
- @_SwiftifyImportProtocol ( . method( name : " func foo(_ ptr: UnsafePointer<CInt>, _ len: CInt) " , paramInfo: [ . countedBy( pointer: . param( 1 ) , count: " len " ) , . nonescaping( pointer: . param( 1 ) ) ] ) ,
39
- . method( name : " func bar(_ ptr: UnsafePointer<CInt>, _ len: CInt) " , paramInfo: [ . countedBy( pointer: . param( 1 ) , count: " len " ) ] ) )
38
+ @_SwiftifyImportProtocol ( . method( signature : " func foo(_ ptr: UnsafePointer<CInt>, _ len: CInt) " , paramInfo: [ . countedBy( pointer: . param( 1 ) , count: " len " ) , . nonescaping( pointer: . param( 1 ) ) ] ) ,
39
+ . method( signature : " func bar(_ ptr: UnsafePointer<CInt>, _ len: CInt) " , paramInfo: [ . countedBy( pointer: . param( 1 ) , count: " len " ) ] ) )
40
40
protocol MixedProtocol {
41
41
func foo( _ ptr: UnsafePointer < CInt > , _ len: CInt )
42
42
func bar( _ ptr: UnsafePointer < CInt > , _ len: CInt )
@@ -55,8 +55,8 @@ protocol MixedProtocol {
55
55
// CHECK-NEXT: }
56
56
// CHECK-NEXT: }
57
57
58
- @_SwiftifyImportProtocol ( . method( name : " func foo(_ ptr: UnsafePointer<CInt>, _ len1: CInt) " , paramInfo: [ . countedBy( pointer: . param( 1 ) , count: " len1 " ) ] ) ,
59
- . method( name : " func foo(bar: UnsafePointer<CInt>, _ len2: CInt) " , paramInfo: [ . countedBy( pointer: . param( 1 ) , count: " len2 " ) ] ) )
58
+ @_SwiftifyImportProtocol ( . method( signature : " func foo(_ ptr: UnsafePointer<CInt>, _ len1: CInt) " , paramInfo: [ . countedBy( pointer: . param( 1 ) , count: " len1 " ) ] ) ,
59
+ . method( signature : " func foo(bar: UnsafePointer<CInt>, _ len2: CInt) " , paramInfo: [ . countedBy( pointer: . param( 1 ) , count: " len2 " ) ] ) )
60
60
protocol OverloadedProtocol {
61
61
func foo( _ ptr: UnsafePointer < CInt > , _ len1: CInt )
62
62
func foo( bar: UnsafePointer < CInt > , _ len2: CInt )
@@ -74,7 +74,7 @@ protocol OverloadedProtocol {
74
74
// CHECK-NEXT: }
75
75
// CHECK-NEXT: }
76
76
77
- @_SwiftifyImportProtocol ( . method( name : " open func myFunc(_ ptr: UnsafePointer<CInt>, _ len: CInt) " , paramInfo: [ . countedBy( pointer: . param( 1 ) , count: " len " ) ] ) )
77
+ @_SwiftifyImportProtocol ( . method( signature : " open func myFunc(_ ptr: UnsafePointer<CInt>, _ len: CInt) " , paramInfo: [ . countedBy( pointer: . param( 1 ) , count: " len " ) ] ) )
78
78
class SimpleClass {
79
79
open func myFunc( _ ptr: UnsafePointer < CInt > , _ len: CInt ) { }
80
80
}
0 commit comments