Commit a7cd6f13 authored by DaniloFreitas's avatar DaniloFreitas

small fixes

parent d69139fc
...@@ -2395,7 +2395,9 @@ class SimpleCallNode(CallNode): ...@@ -2395,7 +2395,9 @@ class SimpleCallNode(CallNode):
actual_nargs = len(self.args) actual_nargs = len(self.args)
possibilities = [] possibilities = []
for entry in entries: for entry in entries:
type = entry.type.base_type type = entry.type
if type.is_ptr:
type = type.base_type
# Check no. of args # Check no. of args
max_nargs = len(type.args) max_nargs = len(type.args)
expected_nargs = max_nargs - type.optional_arg_count expected_nargs = max_nargs - type.optional_arg_count
...@@ -2422,6 +2424,9 @@ class SimpleCallNode(CallNode): ...@@ -2422,6 +2424,9 @@ class SimpleCallNode(CallNode):
possibilities.sort() possibilities.sort()
if len(possibilities) > 1 and possibilities[0][0] == possibilities[1][0]: if len(possibilities) > 1 and possibilities[0][0] == possibilities[1][0]:
error(self.pos, "Ambiguity found on %s" % possibilities[0][1].name) error(self.pos, "Ambiguity found on %s" % possibilities[0][1].name)
self.args = None
self.type = PyrexTypes.error_type
self.result_code = "<error>"
return None return None
return possibilities[0][1] return possibilities[0][1]
error(self.pos, error(self.pos,
...@@ -2442,6 +2447,8 @@ class SimpleCallNode(CallNode): ...@@ -2442,6 +2447,8 @@ class SimpleCallNode(CallNode):
def analyse_c_function_call(self, env): def analyse_c_function_call(self, env):
entry = self.best_match() entry = self.best_match()
if not entry:
return
self.function.entry = entry self.function.entry = entry
self.function.type = entry.type self.function.type = entry.type
func_type = self.function_type() func_type = self.function_type()
......
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