Skip to content

Instantly share code, notes, and snippets.

@H2CO3
Created December 24, 2015 07:48
Show Gist options
  • Save H2CO3/a55b7dbddf767f78d26d to your computer and use it in GitHub Desktop.
Save H2CO3/a55b7dbddf767f78d26d to your computer and use it in GitHub Desktop.
override func llvmType() -> LLVMTypeRef {
// a function with a 'Void' argument is a
// special case: it means '0 arguments'.
var args: [LLVMTypeRef] = []
if self.argType != VoidType() {
args.append(self.argType.llvmType())
}
return LLVMFunctionType(
self.retType.llvmType(),
args.count > 0 ? &args[0] : nil,
UInt32(args.count),
0 // 0: not variadic
)
}
TypeAnn.swift:157:39: error: result values in '? :' expression have mismatching types
'inout LLVMTypeRef' (aka 'inout COpaquePointer') and '_'
args.count > 0 ? &args[0] : nil,
~~~~~~~~ ^ ~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment