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
RBI automatically boxes function parameters and return values. As it turns out, RBI also unboxes function parameters and return values to match a function's declared signature. Consider this example:
Inside of the unboxing function, s is always a primitive string and never an instance of roString. Similarly, the return value of unboxing is also always a primitive string and never an instance of roString.
brs currently doesn't handle this demotion properly, and throws type mismatch errors at runtime 😢
The text was updated successfully, but these errors were encountered:
Another scenario with this same unboxing issue can be reproduced this way:
a=CreateObject("roInt",1)
? a+1
causes an error:
REPL(1,2-5): Attempting to add non-homogeneous values.
left: Object
right: Integer**
In case of a comparison is even worse, as it does not return an error so it silently return false if you compare a roInt with value 1 and the constant 1 like this:
RBI automatically boxes function parameters and return values. As it turns out, RBI also unboxes function parameters and return values to match a function's declared signature. Consider this example:
Inside of the
unboxing
function,s
is always a primitivestring
and never an instance ofroString
. Similarly, the return value ofunboxing
is also always a primitivestring
and never an instance ofroString
.brs
currently doesn't handle this demotion properly, and throws type mismatch errors at runtime 😢The text was updated successfully, but these errors were encountered: