Skip to content
Snippets Groups Projects

Extensions and fixes to the type system

Merged Frederik Hennig requested to merge fhennig/types-extensions into backend-rework
All threads resolved!
Viewing commit d1fbfddc
Prev
Show latest version
1 file
+ 3
1
Preferences
Compare changes
@@ -247,7+247,7 @@
#
# lhs = bitwise_and(a, cast_func(1, 'int'))
# rhs = cast_func(0, 'int')
# print( sp.Ne(lhs, rhs) ) # would give true if all cast_funcs are booleans
# -> thus a separate class boolean_cast_func is introduced
if isinstance(expr, sp.logic.boolalg.Boolean) and (
not isinstance(expr, TypedSymbol) or isinstance(expr.dtype, PsBoolType)
@@ -278,7+278,7 @@
@property
def is_integer(self):
if isinstance(self.dtype, PsNumericType) or self.dtype == DynamicType.INDEX_TYPE:
if self.dtype == DynamicType.INDEX_TYPE:
return True
elif isinstance(self.dtype, PsNumericType):
return self.dtype.is_int() or super().is_integer
else:
return super().is_integer