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
// FIXME: optional pointers are not yet supported but they should be; this crashes
63
+
// takesValue(intPtr)
69
64
70
-
#if CHECK_NO_CRASH
71
-
func takesCFnPtr(){takesValue(functionPtr)}
72
-
// TODO: error: could not generate C++ types from the generic Swift types provided; the following Swift type(s) provided to 'takesValue' could not be converted: (@convention(c) () -> Int32)?
73
-
#endif
65
+
// It's fine if we dereference it, though
66
+
takesValue(intPtr!)
67
+
}
74
68
75
-
#if CHECK_NO_CRASH
76
-
// Uniformly-typed tuples are not yet supported but they should be
77
-
func takesBoolTuple(){takesValue((true,false))}
78
-
// TODO: error: could not generate C++ types from the generic Swift types provided; the following Swift type(s) provided to 'takesValue' could not be converted: (Bool, Bool)
79
-
func takesIntTuple(){takesValue((42,0))}
80
-
// TODO: error: could not generate C++ types from the generic Swift types provided; the following Swift type(s) provided to 'takesValue' could not be converted: (Int, Int)
81
-
#endif
69
+
func takesCFnPtr(){
70
+
takesValue(get42) // function symbol
71
+
// FIXME: optional pointers are not yet supported but they should be; this crashes
72
+
// takesValue(functionPtrGet42)
73
+
takesValue(functionPtrGet42!) // dereferenced nullable function pointer
74
+
takesValue(nonNullFunctionPtrGet42) // non-null function symbol
0 commit comments