Type inference for function pointers