forked from M-Labs/artiq
compiler: Support numpy.float
This would previously crash the compiler.
This commit is contained in:
parent
8783ba2072
commit
ad34df3de1
|
@ -166,6 +166,10 @@ class ASTSynthesizer:
|
||||||
typ = builtins.TBool()
|
typ = builtins.TBool()
|
||||||
return asttyped.NameConstantT(value=value, type=typ,
|
return asttyped.NameConstantT(value=value, type=typ,
|
||||||
loc=self._add(repr(value)))
|
loc=self._add(repr(value)))
|
||||||
|
elif value is numpy.float:
|
||||||
|
typ = builtins.fn_float()
|
||||||
|
return asttyped.NameConstantT(value=None, type=typ,
|
||||||
|
loc=self._add("numpy.float"))
|
||||||
elif value is numpy.int32:
|
elif value is numpy.int32:
|
||||||
typ = builtins.fn_int32()
|
typ = builtins.fn_int32()
|
||||||
return asttyped.NameConstantT(value=None, type=typ,
|
return asttyped.NameConstantT(value=None, type=typ,
|
||||||
|
|
Loading…
Reference in New Issue