From ad34df3de1e73926c8de0a3fbeaba5299ba34896 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Sun, 9 Aug 2020 02:43:37 +0100 Subject: [PATCH] compiler: Support numpy.float This would previously crash the compiler. --- artiq/compiler/embedding.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/artiq/compiler/embedding.py b/artiq/compiler/embedding.py index 03be54a94..c327392f8 100644 --- a/artiq/compiler/embedding.py +++ b/artiq/compiler/embedding.py @@ -166,6 +166,10 @@ class ASTSynthesizer: typ = builtins.TBool() return asttyped.NameConstantT(value=value, type=typ, 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: typ = builtins.fn_int32() return asttyped.NameConstantT(value=None, type=typ,