Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buffer library doesn't accept buffers in new type solver's non-strict mode #1267

Closed
Ketasaja opened this issue May 26, 2024 · 3 comments · Fixed by #1278
Closed

buffer library doesn't accept buffers in new type solver's non-strict mode #1267

Ketasaja opened this issue May 26, 2024 · 3 comments · Fixed by #1278
Labels
bug Something isn't working new solver This issue is specific to the new solver.

Comments

@Ketasaja
Copy link
Contributor

Ketasaja commented May 26, 2024

local b = buffer.create(100)
buffer.writef64(b, 0, 5) -- TypeError: Function 'buffer.writef64' expects 'buffer' at argument #0, but got 'buffer'
buffer.readi8(b, 0) -- TypeError: Function 'buffer.readi8' expects 'buffer' at argument #0, but got 'buffer'

Tested on 0.627, with no errors when using strict mode.

@Ketasaja Ketasaja added the bug Something isn't working label May 26, 2024
@alexmccord alexmccord added the new solver This issue is specific to the new solver. label May 28, 2024
@alexmccord
Copy link
Contributor

Thanks for catching this! Fix for this is coming in the next sync.

@Ketasaja
Copy link
Contributor Author

Ketasaja commented Jun 1, 2024

@alexmccord I found a similar issue with function parameters, with 0.628.0 in non-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.writeu32(b, 0, 0)
end

@alexmccord
Copy link
Contributor

Can you open a new issue for that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new solver This issue is specific to the new solver.
Development

Successfully merging a pull request may close this issue.

2 participants