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
Yeah it seems that the array is inferred to be Int[], as you said, because integer literals are of type Int and the whole array is then implicitely casted to SSizeT[].
Rock doesn't recognize that elements of the array must be casted, it only casts the array itself.
As a temporary workaround, you can cast the first element of the array (when constructing it) to SSizeT to force rock to infer the type of the array to SSizeT.
I'm pretty sure rock should forbid array casts of any form. In your case.. it might be that it should work, I'm not entirely sure yet. But I'm wondering what's the timing with autoReturn. It would have to be aware it's returned to infer its type, so:
// would workfoo: func->SSizeT[] {
[1, 2, 3]
}
// wouldn't workfoo: func->SSizeT[] {
a:= [1, 2, 3]
a
}
So.. is it really worth trying to make it work like that?
gives:
instead of
8589934593 = 2<<32 + 1
Generated Code:
It clear that [1,2,3] is infered as Int[] but used as SSizeT[] without (element-wise) cast.
The text was updated successfully, but these errors were encountered: