Skip to content
Snippets Groups Projects
Commit e2f3d6fa authored by Andreas Klöckner's avatar Andreas Klöckner Committed by Andreas Klöckner
Browse files

Type inference for np.generic: Return the specified dtype

parent 8a2ff4be
No related branches found
No related tags found
No related merge requests found
...@@ -355,6 +355,8 @@ class TypeInferenceMapper(CombineMapper): ...@@ -355,6 +355,8 @@ class TypeInferenceMapper(CombineMapper):
return self.combine([n_dtype_set, d_dtype_set]) return self.combine([n_dtype_set, d_dtype_set])
def map_constant(self, expr): def map_constant(self, expr):
if isinstance(expr, np.generic):
return [NumpyType(np.dtype(type(expr)))]
if is_integer(expr): if is_integer(expr):
for tp in [np.int32, np.int64]: for tp in [np.int32, np.int64]:
iinfo = np.iinfo(tp) iinfo = np.iinfo(tp)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment