Fixes none to bool coercion

Fixes #1413 and #1414.
This commit is contained in:
pca006132 2020-10-06 14:55:02 +08:00 committed by Sébastien Bourdeauducq
parent 88d346fa26
commit 02f46e8b79

View File

@ -417,6 +417,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}",