Commit 6fa55268 authored by Stefan Behnel's avatar Stefan Behnel

make it explicit where type sorting is used in fused function dispatch

parent f599da79
......@@ -483,8 +483,10 @@ class FusedCFuncDefNode(StatListNode):
Specialize fused types and split into normal types and buffer types.
"""
specialized_types = PyrexTypes.get_specialized_types(arg.type)
# Prefer long over int, etc
# specialized_types.sort()
# Prefer long over int, etc by sorting (see type classes in PyrexTypes.py)
specialized_types.sort()
seen_py_type_names = set()
normal_types, buffer_types = [], []
has_object_fallback = False
......
......@@ -3011,10 +3011,10 @@ def specialization_signature_string(fused_compound_type, fused_to_specific):
return fused_type.specialize(fused_to_specific).typeof_name()
def get_specialized_types(type):
"""
Return a list of specialized types sorted in reverse order in accordance
with their preference in runtime fused-type dispatch
Return a list of specialized types in their declared order.
"""
assert type.is_fused
......@@ -3030,7 +3030,7 @@ def get_specialized_types(type):
specialization_signature_string(type, f2s))
result.append(specialized_type)
return sorted(result)
return result
class CFuncTypeArg(BaseType):
......
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