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 authored and inducer committed Jul 19, 2024
1 parent da5c786 commit 07cee43
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 07cee43

Please sign in to comment.