luau icon indicating copy to clipboard operation
luau copied to clipboard

New Solver: cannot pass `string.byte` as last argument to `buffer.writeu8`

Open JohnnyMorganz opened this issue 10 months ago • 1 comments

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(" "))

JohnnyMorganz avatar Mar 02 '25 10:03 JohnnyMorganz

~~Can no longer reproduce in latest version of luau-lsp~~

Nevermind, I was checking wrong - it still errors in strict mode!

JohnnyMorganz avatar Sep 20 '25 14:09 JohnnyMorganz