Skip to content

Commit

Permalink
TypeInferenceMapper: allow np.bool in map_type_case
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasdiener committed Jul 18, 2024
1 parent 7d5a1fb commit f494955
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion loopy/type_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def map_constant(self, expr):

def map_type_cast(self, expr):
subtype, = self.rec(expr.child)
if not issubclass(subtype.dtype.type, np.number):
if not issubclass(subtype.dtype.type, (np.number, np.bool_)):
raise LoopyError(f"Can't cast a '{subtype}' to '{expr.type}'")
return [expr.type]

Expand Down

0 comments on commit f494955

Please sign in to comment.