dibyendumajumdar / ravi

Ravi is a dialect of Lua, featuring limited optional static typing, JIT and AOT compilers
http://ravilang.github.io/
Other
1.16k stars 60 forks source link

Some more typechecking bugs #215

Open dibyendumajumdar opened 3 years ago

dibyendumajumdar commented 3 years ago
function x(a: integer, b: integer[])
        local a1 = a[0]
end

It should not be possible to index an variable that is marked as integer. This will fail at runtime except if someone sets a meta-table on integer.

But following should fail:

function x(a: integer)
        local a1:integer = a[0]
end