From 7f79a54255ca93c93750e42f6031cc4d1695369c Mon Sep 17 00:00:00 2001 From: pca006132 Date: Tue, 6 Oct 2020 14:55:02 +0800 Subject: [PATCH] Fixes none to bool coercion Fixes #1413 and #1414. --- artiq/compiler/transforms/artiq_ir_generator.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/artiq/compiler/transforms/artiq_ir_generator.py b/artiq/compiler/transforms/artiq_ir_generator.py index a794e9990..a57135ed3 100644 --- a/artiq/compiler/transforms/artiq_ir_generator.py +++ b/artiq/compiler/transforms/artiq_ir_generator.py @@ -408,6 +408,8 @@ class ARTIQIRGenerator(algorithm.Visitor): length = self.iterable_len(insn) return self.append(ir.Compare(ast.NotEq(loc=None), length, ir.Constant(0, length.type)), block=block) + elif builtins.is_none(insn.type): + return ir.Constant(False, builtins.TBool()) else: note = diagnostic.Diagnostic("note", "this expression has type {type}",