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
If this is not currently intended to permissible in the language, the crash should be fixed and a compiler error should be printed instead. For example:
I had the same issue reported as radar, and duplicated it here as well SR-41. Sorry for duplication, as I didn't expect this issue to be so popular and already reported by someone else. Apparently there was one already reported.
Variadics are a distinct type from "ground types". If you want to pass them around, you have to explicitly annotate the function as accepting that kind of type. Swift's type system does not support arity-generic overloads like you suspect it should here (though this may be something you could go through the evolution process to ask for if you think it is a useful feature). If you need to invoke these variadic functions, you must explicitly apply the necessary number of arguments. For example:
If you need to pass these functions, then you can annotate the types of each function as accepting a variadic number of arguments and we'll figure out the rest for you (but you must maintain invariance [as though they were an [Blah] instead of Blah...])
Environment
El Capitan, late 2013 Retina MacBook Pro
Apple Swift version 2.2-dev (LLVM 46be9ff861, Clang 4deb154edc, Swift 778f829)
Target: x86_64-apple-macosx10.9
Additional Detail from JIRA
md5: df05c318f165adcec0ebd665df8e3438
relates to:
Issue Description:
If I define a variadic function:
I would expect this to be acceptable anywhere
Int -> ()
,(Int, Int) -> ()
, etc. were. For example:However, the compiler crashes with this error:
If this is not currently intended to permissible in the language, the crash should be fixed and a compiler error should be printed instead. For example:
Prints the error:
The text was updated successfully, but these errors were encountered: