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

checker: free fixed array #20318

Closed
enghitalo opened this issue Dec 31, 2023 · 0 comments · Fixed by #20320
Closed

checker: free fixed array #20318

enghitalo opened this issue Dec 31, 2023 · 0 comments · Fixed by #20320
Assignees
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@enghitalo
Copy link
Contributor

enghitalo commented Dec 31, 2023

Describe the bug

checker is allowing free fixed array

Reproduction Steps

fn main() {
	mut buffer := [u8(`0`), `0`, `0`, `0`, `-`, `0`, `0`, `-`, `0`, `0`, `T`, `0`, `0`, `:`, `0`, `0`, `:`, `0`, `0`, `.`, `0`, `0`, `0`, `Z`]!
	defer {
		unsafe { buffer.free() }
	}
}

Expected Behavior

A nice error

Current Behavior

[24]u8
could not generate free method 'Array_fixed_u8_24_free' for type 'Array_fixed_u8_24'
==================
/tmp/v_1000/discardable.11898467953784003877.tmp.c:12674: error: lvalue expected
...
==================
(Use `v -cg` to print the entire error message)

builder error: 
==================
C error. This should never happen.

This is a compiler bug, please report it using `v bug file.v`.

https://github.com/vlang/v/issues/new/choose

You can also use #help on Discord: https://discord.gg/vlang

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.3 9694024

Environment details (OS name and version, etc.)

Ubuntu

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@enghitalo enghitalo added the Bug This tag is applied to issues which reports bugs. label Dec 31, 2023
@enghitalo enghitalo changed the title checker checker: free fixed array Dec 31, 2023
@Delta456 Delta456 self-assigned this Dec 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants