Commit e2e70027 authored by Stefan Behnel's avatar Stefan Behnel

avoid some more accidental type coercion helper code generation

parent 184f7edc
......@@ -1251,6 +1251,9 @@ class CConstType(BaseType):
def deduce_template_params(self, actual):
return self.const_base_type.deduce_template_params(actual)
def can_coerce_to_pyobject(self, env):
return self.const_base_type.can_coerce_to_pyobject(env)
def create_to_py_utility_code(self, env):
if self.const_base_type.create_to_py_utility_code(env):
self.to_py_function = self.const_base_type.to_py_function
......@@ -1420,6 +1423,9 @@ class CIntType(CNumericType):
from_py_function = None
exception_value = -1
def can_coerce_to_pyobject(self, env):
return True
def create_to_py_utility_code(self, env):
if type(self).to_py_function is None:
self.to_py_function = "__Pyx_PyInt_From_" + self.specialization_name()
......@@ -1765,6 +1771,9 @@ class CComplexType(CNumericType):
is_float = self.real_type.is_float))
return True
def can_coerce_to_pyobject(self, env):
return True
def create_to_py_utility_code(self, env):
env.use_utility_code(complex_real_imag_utility_code)
env.use_utility_code(complex_to_py_utility_code)
......@@ -2397,9 +2406,8 @@ class CFuncType(CType):
# is exempt from compatibility checking (the proper check
# is performed elsewhere).
for i in range(as_cmethod, nargs):
if not self.args[i].type.same_as(
other_type.args[i].type):
return 0
if not self.args[i].type.same_as(other_type.args[i].type):
return 0
if self.has_varargs != other_type.has_varargs:
return 0
if self.optional_arg_count != other_type.optional_arg_count:
......
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