luau
luau copied to clipboard
New Solver: cannot pass `string.byte` as last argument to `buffer.writeu8`
Minimized example from https://github.com/aatxe/lute/blob/primary/batteries/json.luau
Not quite sure if this is a bug or working as intended, but cannot pass a function returning a type pack to buffer.writeu8 that only accepts one last argument.
local buf = buffer.create(0)
local cursor = 0
-- on 'string.byte' argument
-- TypeError: Type pack 'buffer, number, number' could not be converted into '...number'
buffer.writeu8(buf, cursor, string.byte(" "))
~~Can no longer reproduce in latest version of luau-lsp~~
Nevermind, I was checking wrong - it still errors in strict mode!