You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cppia jit: Array contains, remove and Array<Bool> element results are boxed as Int #260
In the cppia jit, Array.contains and Array.remove results, and Array<Bool> elements read or written, become an Int instead of a Bool when they are boxed to Dynamic. The interpreter and C++ give Bools.
C++ and the cppia interpreter print [true,true,true,false] [true,true,true,true]. The jit stored 1, 1, 1 and 0, none of them a Bool.
The jit carries Bools as Int and asks an expression's isBoolInt() when it boxes one. ArrayVirtual answered it for remove and contains, but the typed ArrayBuiltin did not, and neither did the Bool element get and set or ArraySetter.
The cross-target output comparison (#150) found it on its first run: the jit was the only engine whose output differed from C++. Related to #134, which fixed other Bool results that came back as Int. #259 is a separate path: a Bool stored in a dynamic field.
Fixed in a7273a8: ArrayBuiltin and ArraySetter now report Bool results through isBoolInt(), and CppiaBoolBuiltins covers the literal above in the interpreter and the jit.
Activity
dimensionscape commentedon Oct 22, 2026
Fixed in a7273a8:
ArrayBuiltinandArraySetternow report Bool results throughisBoolInt(), andCppiaBoolBuiltinscovers the literal above in the interpreter and the jit.