mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
@_dynamicReplacement(for: selfRec(x: acc:))
func selfRec_r(x: Int, acc: Int) -> Int {
if x <= 0 {
return acc
}
// Normally, this will call selfRec(x: acc:)'s implementation.
// With the option, this will call to selfRec_r(x: acc:).
return selfRec(x: x - 1, acc: acc + 1)
}
rdar://51229650
18 lines
317 B
Swift
18 lines
317 B
Swift
public dynamic func selfRec(_ x: Int, _ acc: Int) -> Int {
|
|
return 0
|
|
}
|
|
|
|
public class AClass {
|
|
public init() {}
|
|
public dynamic func selfRec(_ x: Int, _ acc: Int) -> Int {
|
|
return 0
|
|
}
|
|
}
|
|
|
|
public class AStruct {
|
|
public init() {}
|
|
public dynamic func selfRec(_ x: Int, _ acc: Int) -> Int {
|
|
return 0
|
|
}
|
|
}
|