Skip to content

Instantly share code, notes, and snippets.

@alexnask
Created September 2, 2011 17:08
Show Gist options
  • Select an option

  • Save alexnask/1189179 to your computer and use it in GitHub Desktop.

Select an option

Save alexnask/1189179 to your computer and use it in GitHub Desktop.
Possible fix
// We eliminate any generic variable that is passed as a "true" function argument
// E.g. in __va_call: inline func <T> (f: Func <T> (T), T: Class, arg: T)
typeArgs := fDecl typeArgs filter(|arg| !fDecl args contains?(arg))
/* Step 3 : write generic type args */
for(typeArg in typeArgs) {
if(isFirst) isFirst = false
else hw app(", ")
hw app(typeArg getName())
}
/* Step 4 : write real args */
for(arg in fDecl args) {
if(isFirst) isFirst = false
else hw app(", ")
if(arg instanceOf?(VarArg)) hw app("...")
else hw app(arg getName())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment