File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,23 @@ public func bar(_ x: [Int64], sum: Int64) -> Int64 {
20
20
return temp
21
21
}
22
22
23
+ // Make sure the generic signature of foo is always serialized. Otherwise, the
24
+ // sil scope in fooCaller refers to the generic version of foo
25
+ @inlinable @inline ( __always)
26
+ func foo< T: AdditiveArithmetic > ( _ x: T , _ y : T ) -> T {
27
+ return x + y
28
+ }
29
+
30
+ @inline ( never) @_alwaysEmitIntoClient
31
+ public func fooCaller< T: AdditiveArithmetic > ( _ x: T , _ y : T ) -> T {
32
+ return foo ( x, y)
33
+ }
34
+
23
35
// BEGIN Main.swift
24
36
import MyModule
37
+ // sil_scope should refer to the specialized version of foo
38
+ //CHECK: sil_scope {{.*}} { loc "{{.*}}MyModule.swift":11:6 parent @$s8MyModule3fooyxx_xts18AdditiveArithmeticRzlFSi_TG5 {{.*}} inlined_at {{.*}} }
39
+ let _ = fooCaller ( 1 , 2 )
25
40
26
41
func test( ) {
27
42
let _ = bar ( [ 10 ] , sum: 0 )
You can’t perform that action at this time.
0 commit comments