Commit a46f5295 authored by Robert Bradshaw's avatar Robert Bradshaw

Function overloading fixes.

parent b3ebcbb8
......@@ -2580,17 +2580,20 @@ class SimpleCallNode(CallNode):
def analyse_c_function_call(self, env):
if self.function.type is error_type:
self.type = self.function.type
self.type = error_type
return
if self.function.type.is_cpp_class:
function = self.function.type.scope.lookup("operator()")
if function is None:
overloaded_entry = self.function.type.scope.lookup("operator()")
if overloaded_entry is None:
self.type = PyrexTypes.error_type
self.result_code = "<error>"
return
elif hasattr(self.function, 'entry'):
overloaded_entry = self.function.entry
else:
function = self.function.entry
entry = PyrexTypes.best_match(self.args, function.all_alternatives(), self.pos)
overloaded_entry = None
if overloaded_entry:
entry = PyrexTypes.best_match(self.args, overloaded_entry.all_alternatives(), self.pos)
if not entry:
self.type = PyrexTypes.error_type
self.result_code = "<error>"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment