opshin icon indicating copy to clipboard operation
opshin copied to clipboard

Recursion error when automatically converting bool to int

Open nielstron opened this issue 10 months ago • 0 comments

Describe the bug

  File "test.py", line 4
    return 1 + (a < b)
          ^
RecursionError: maximum recursion depth exceeded in comparison
Note that opshin errors may be overly restrictive as they aim to prevent code with unintended consequences.

To Reproduce

$ cat test.py 
from opshin.prelude import *

def validator(a: bool, b: bool) -> int:
    return 1 + (a < b)
$ opshin build test.py

Expected behavior Should not give recursion error.

nielstron avatar Apr 11 '24 19:04 nielstron