Bug-report: CircuitBlocks generates wrong return type for function

This seems like a bug to me. The return type of this function should be string, not boolean.

no, if conditions always return true or false values, not string values. your better of making the condition inside, with the actual block, and making a variable called state, setting the state to what your doing, and returning the state variable. The rectangle blocks are boolean outputs by the way.

As you can see from the screenshot, the generated code will always return a string, not a boolean. CircuitBlocks incorrectly infers the ternary expression as a boolean.

@oscar you are right, thank you for reporting the bug. We’ve put this on out to-do list and will apply a fix as soon as possible

1 Like

Awesome! Thanks @albertgajsak

image