You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: validation-test/compiler_crashers_2_fixed/sr12723.swift
+12-6Lines changed: 12 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -35,35 +35,41 @@ func cContext() {
35
35
letc=SR12723_C{ app inapp()}
36
36
37
37
proxy(c.function)
38
-
// expected-error@-1 {{cannot convert value of type '(@convention(c) () -> Void) -> Void' to expected argument type '(() -> Void) -> Void'}}
38
+
// expected-error@-1 {{converting non-escaping value to '@convention(c) () -> Void' may allow it to escape}}
39
+
// expected-error@-2 {{cannot convert value of type '(@convention(c) () -> Void) -> Void' to expected argument type '(() -> Void) -> Void'}}
39
40
40
41
let _ :(@convention(block)()->Void)->Void= c.function
41
-
// expected-error@-1 {{cannot convert value of type '(@convention(c) () -> Void) -> Void' to specified type '(@convention(block) () -> Void) -> Void'}}
42
+
// expected-error@-1 {{converting non-escaping value to '@convention(c) () -> Void' may allow it to escape}}
43
+
// expected-error@-2 {{cannot convert value of type '(@convention(c) () -> Void) -> Void' to specified type '(@convention(block) () -> Void) -> Void'}}
42
44
43
45
let _ :(@convention(c)()->Void)->Void= c.function // OK
44
46
45
47
let _ :(@convention(thin)()->Void)->Void= c.function // OK
46
48
47
49
let _ :(()->Void)->Void= c.function
48
-
// expected-error@-1 {{cannot convert value of type '(@convention(c) () -> Void) -> Void' to specified type '(() -> Void) -> Void'}}
50
+
// expected-error@-1 {{converting non-escaping value to '@convention(c) () -> Void' may allow it to escape}}
51
+
// expected-error@-2 {{cannot convert value of type '(@convention(c) () -> Void) -> Void' to specified type '(() -> Void) -> Void'}}
49
52
50
53
}
51
54
52
55
func thinContext(){
53
56
letthin=SR12723_Thin{ app inapp()}
54
57
55
58
proxy(thin.function)
56
-
// expected-error@-1 {{cannot convert value of type '(@convention(thin) () -> Void) -> Void' to expected argument type '(() -> Void) -> Void'}}
59
+
// expected-error@-1 {{converting non-escaping value to '@convention(thin) () -> Void' may allow it to escape}}
60
+
// expected-error@-2 {{cannot convert value of type '(@escaping @convention(thin) () -> Void) -> Void' to expected argument type '(() -> Void) -> Void'}}
57
61
58
62
let _ :(@convention(block)()->Void)->Void= thin.function
59
-
// expected-error@-1 {{cannot convert value of type '(@convention(thin) () -> Void) -> Void' to specified type '(@convention(block) () -> Void) -> Void'}}
63
+
// expected-error@-1 {{converting non-escaping value to '@convention(thin) () -> Void' may allow it to escape}}
64
+
// expected-error@-2 {{cannot convert value of type '(@escaping @convention(thin) () -> Void) -> Void' to specified type '(@convention(block) () -> Void) -> Void'}}
60
65
61
66
let _ :(@convention(c)()->Void)->Void= thin.function // OK
62
67
63
68
let _ :(@convention(thin)()->Void)->Void= thin.function // OK
64
69
65
70
let _ :(()->Void)->Void= thin.function
66
-
// expected-error@-1 {{cannot convert value of type '(@convention(thin) () -> Void) -> Void' to specified type '(() -> Void) -> Void'}}
71
+
// expected-error@-1 {{converting non-escaping value to '@convention(thin) () -> Void' may allow it to escape}}
72
+
// expected-error@-2 {{cannot convert value of type '(@escaping @convention(thin) () -> Void) -> Void' to specified type '(() -> Void) -> Void'}}
0 commit comments