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

Fixed array initialisation #19661

Closed
Eliyaan opened this issue Oct 26, 2023 · 0 comments · Fixed by #19663
Closed

Fixed array initialisation #19661

Eliyaan opened this issue Oct 26, 2023 · 0 comments · Fixed by #19663
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@Eliyaan
Copy link
Contributor

Eliyaan commented Oct 26, 2023

Describe the bug

Cant initialise the fixed size array.

Reproduction Steps

const (
    c = int(1)
)

print(c)
a := [c]int{}
dump(a)

Current Behavior

file.v:7:7: error: fixed size cannot be zero or negative (fixed_size: 0)
    5 |
    6 | print(c)
    7 | a := [c]int{}
      |       ^
    8 | dump(a)

V version

Current V version: V 0.4.2 c09b66b, timestamp: 2023-10-26 09:51:44 +0300

Environment details (OS name and version, etc.)

OS: windows, Microsoft Windows 10 Education v19045 64 bits

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.

@Eliyaan Eliyaan added the Bug This tag is applied to issues which reports bugs. label Oct 26, 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.

1 participant