luau-lang / luau

A fast, small, safe, gradually typed embeddable scripting language derived from Lua
https://luau-lang.org
MIT License
3.79k stars 349 forks source link

`buffer` library `TypeError` when buffer is function parameter with new solver's non-strict mode #1279

Open Ketasaja opened 1 month ago

Ketasaja commented 1 month ago

Tested on 0.628, with no errors in strict mode:

local function _(b: buffer) -- TypeError: Argument b with type 'unknown' in function '_' is used in a way that will run time error
    buffer.readi32(b, 0)
end

local buf = buffer.create(100)
buffer.readi32(buf, 0)