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