Option types introduced some regressions, this PR fixes them and adds tests for those cases.
First regression was indexing an array of arrays, the type checker was not coercing the option in the e1 part of e1[e2] to its non-option version, so code like x[...][...] was failing because x[...] did not have an array type.
Second regression was comparing two option types, which should be like comparing two values. Code like a[1] == b[1] that used to work now was having generating wrong C code because it was trying to compare two TValues (the underlying C type of Lua slots and Titan option types) directly using ==.
Option types introduced some regressions, this PR fixes them and adds tests for those cases.
First regression was indexing an array of arrays, the type checker was not coercing the option in the
e1
part ofe1[e2]
to its non-option version, so code likex[...][...]
was failing becausex[...]
did not have an array type.Second regression was comparing two option types, which should be like comparing two
value
s. Code likea[1] == b[1]
that used to work now was having generating wrong C code because it was trying to compare twoTValue
s (the underlying C type of Lua slots and Titan option types) directly using==
.