@@ -19,6 +19,9 @@ import FakeDistributedActorSystems
19
19
20
20
typealias DefaultDistributedActorSystem = FakeRoundtripActorSystem
21
21
22
+ protocol SomeProtocol { }
23
+ extension String : SomeProtocol { }
24
+
22
25
distributed actor Greeter {
23
26
distributed func noParams( ) { }
24
27
distributed func noParamsThrows( ) throws { }
@@ -28,9 +31,9 @@ distributed actor Greeter {
28
31
distributed func oneLabel( value: String , _ value2: String , _ value3: String ) { }
29
32
distributed func parameterSingle( first: String ) { }
30
33
distributed func parameterPair( first: String , second: Int ) { }
31
- // FIXME( distributed): rdar://90293494 fails to get
32
- // distributed func generic <A: Codable & Sendable>(first: A) {}
33
- // distributed func genericNoLabel <A: Codable & Sendable>(_ first: A) {}
34
+ distributed func generic < A : Codable & Sendable > ( first : A ) { }
35
+ distributed func genericThree < A: Codable & Sendable & SomeProtocol > ( first: A ) { }
36
+ distributed func genericThreeTwo < A: Codable & Sendable , B : Codable & SomeProtocol > ( first: A , second : B ) { }
34
37
}
35
38
extension Greeter {
36
39
distributed func parameterTriple( first: String , second: Int , third: Double ) { }
@@ -65,16 +68,25 @@ func test() async throws {
65
68
_ = try await greeter. parameterTriple ( first: " X " , second: 2 , third: 3.0 )
66
69
// CHECK: >> remoteCallVoid: on:main.Greeter, target:main.Greeter.parameterTriple(first:second:third:)
67
70
68
- // FIXME: rdar://90293494 seems to fail getting the substitutions?
69
- // _ = try await greeter.generic(first: "X")
70
- // // TODO: >> remoteCallVoid: on:main.Greeter, target:main.Greeter.parameterTriple(first:second:third:)
71
+ _ = try await greeter. generic ( first: " X " )
72
+ // CHECK: >> remoteCallVoid: on:main.Greeter, target:main.Greeter.generic(first:)
73
+
74
+ _ = try await greeter. genericThree ( first: " X " )
75
+ // CHECK: >> remoteCallVoid: on:main.Greeter, target:main.Greeter.genericThree(first:)
76
+
77
+ _ = try await greeter. genericThreeTwo ( first: " X " , second: " SecondValue " )
78
+ // CHECK: >> remoteCallVoid: on:main.Greeter, target:main.Greeter.genericThreeTwo(first:second:)
71
79
72
80
print ( " done " )
73
81
// CHECK: done
74
82
}
75
83
76
84
@main struct Main {
77
85
static func main( ) async {
78
- try ! await test ( )
86
+ do {
87
+ try await test ( )
88
+ } catch {
89
+ print ( " ERROR: \( error) " )
90
+ }
79
91
}
80
92
}
0 commit comments