Skip to content

Commit d72dcd0

Browse files
author
viv-eth
committed
[DeeployTest] Change order of typeMatching entries
1 parent 3871115 commit d72dcd0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

DeeployTest/testUtils/typeMapping.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,13 @@ def inferInputType(_input: np.ndarray,
8484
if _type.checkPromotion(_input - signPropOffset):
8585
matchingTypes.append(offsetType(PointerClass(_type), signPropOffset))
8686
elif isInteger(_input):
87-
for _type in sorted(IntegerDataTypes, key = lambda x: x.typeWidth):
87+
sorted_types = sorted(
88+
IntegerDataTypes,
89+
key = lambda t: (t.typeWidth, t.typeMin < 0),
90+
)
91+
92+
matchingTypes = []
93+
for _type in sorted_types:
8894
if _type.checkPromotion(_input):
8995
matchingTypes.append(offsetType(PointerClass(_type), 0))
9096
else:

0 commit comments

Comments
 (0)