1
0
forked from M-Labs/artiq
David Nadlinger 01352236ee compiler: Fix type inference for "ternary" if expressions
Previously, any type would be accepted for the test expression,
leading to internal errors in the code generator if the passed
value wasn't in fact a bool.
2021-03-21 18:43:56 +08:00

7 lines
186 B
Python

# RUN: %python -m artiq.compiler.testbench.inferencer %s >%t
# RUN: OutputCheck %s --file-to-check=%t
# CHECK-L: def foo(val:bool)->numpy.int?:
def foo(val):
return 1 if val else 0