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

C error with a := [ none ] #23457

Open
jorgeluismireles opened this issue Jan 13, 2025 · 2 comments
Open

C error with a := [ none ] #23457

jorgeluismireles opened this issue Jan 13, 2025 · 2 comments
Labels
Bug This tag is applied to issues which reports bugs. Good First Issue (easy task) This issue is suitable to be worked on by new contributors. Unit: Checker Bugs/feature requests, that are related to the type checker.

Comments

@jorgeluismireles
Copy link

jorgeluismireles commented Jan 13, 2025

Describe the bug

Trying to get the difference of a := [ ?string(none) ] and a := [ none ] after reading issue #23452 I got a C error.

Reproduction Steps

fn main() {
	a := [none]
	println('${a}')
}

Expected Behavior

Something unknown but other than C error.

Current Behavior

Running code...
Can't run code. The server returned an error:
/tmp/v_60000/../../../../../../box/code.v:2: error: cannot convert 'extern struct IError' to 'unsigned char'
builder error: 
==================
C error found. It should never happen, when compiling pure V code.
This is a V compiler bug, please report it using `v bug file.v`,
or goto https://github.com/vlang/v/issues/new/choose .
You can also use #help on Discord: https://discord.gg/vlang .
Exited with error status 1
Please try again.

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.9 3523c44

Environment details (OS name and version, etc.)

https://play.vlang.io/p/da8d1b7315

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.

@jorgeluismireles jorgeluismireles added the Bug This tag is applied to issues which reports bugs. label Jan 13, 2025
Copy link

Connected to Huly®: V_0.6-21887

@felipensp felipensp added Good First Issue (easy task) This issue is suitable to be worked on by new contributors. Unit: Checker Bugs/feature requests, that are related to the type checker. labels Jan 13, 2025
@jorgeluismireles
Copy link
Author

I run the script locally and didn't failed: prints [none], though playground still fails as reported above.

I have the same version as playground:

$ uname -a
Linux jorge-xxx 6.8.0-51-generic #52~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Dec  9 15:00:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
$ v version
V 0.4.9 f9106a8
$ cat bugs/array_with_none.v 
module main

fn main() {
	a := [none]
	println('${a}')
}
$ v run bugs/array_with_none.v 
[none]
$ 

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. Good First Issue (easy task) This issue is suitable to be worked on by new contributors. Unit: Checker Bugs/feature requests, that are related to the type checker.
Projects
None yet
Development

No branches or pull requests

2 participants