22
33// 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
44
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 " ) ] ) )
66protocol SimpleProtocol {
77 func myFunc( _ ptr: UnsafePointer < CInt > , _ len: CInt )
88}
@@ -14,8 +14,8 @@ protocol SimpleProtocol {
1414// CHECK-NEXT: }
1515// CHECK-NEXT: }
1616
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) ] ) )
1919protocol SpanProtocol {
2020 func foo( _ ptr: UnsafePointer < CInt > , _ len: CInt )
2121 func bar( _ len: CInt ) -> UnsafePointer < CInt >
@@ -35,8 +35,8 @@ protocol SpanProtocol {
3535// CHECK-NEXT: }
3636// CHECK-NEXT: }
3737
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 " ) ] ) )
4040protocol MixedProtocol {
4141 func foo( _ ptr: UnsafePointer < CInt > , _ len: CInt )
4242 func bar( _ ptr: UnsafePointer < CInt > , _ len: CInt )
@@ -55,8 +55,8 @@ protocol MixedProtocol {
5555// CHECK-NEXT: }
5656// CHECK-NEXT: }
5757
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 " ) ] ) )
6060protocol OverloadedProtocol {
6161 func foo( _ ptr: UnsafePointer < CInt > , _ len1: CInt )
6262 func foo( bar: UnsafePointer < CInt > , _ len2: CInt )
@@ -74,7 +74,7 @@ protocol OverloadedProtocol {
7474// CHECK-NEXT: }
7575// CHECK-NEXT: }
7676
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 " ) ] ) )
7878class SimpleClass {
7979 open func myFunc( _ ptr: UnsafePointer < CInt > , _ len: CInt ) { }
8080}
0 commit comments