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

dump of a fixed array of option strings fails to compile #19469

Closed
spytheman opened this issue Sep 29, 2023 · 1 comment · Fixed by #19479
Closed

dump of a fixed array of option strings fails to compile #19469

spytheman opened this issue Sep 29, 2023 · 1 comment · Fixed by #19479
Labels
Bug This tag is applied to issues which reports bugs. Unit: cgen Bugs/feature requests, that are related to the default C generating backend. Unit: Compiler Bugs/feature requests, that are related to the V compiler in general.

Comments

@spytheman
Copy link
Member

spytheman commented Sep 29, 2023

V doctor:

V full version: V 0.4.1 8f69bd1.b5f71df
OS: linux, Ubuntu 20.04.6 LTS
Processor: 4 cpus, 64bit, little endian, Intel(R) Core(TM) i3-3225 CPU @ 3.30GHz

getwd: /space/v/vnew
vexe: /space/v/vnew/v
vexe mtime: 2023-09-29 02:48:24

vroot: OK, value: /space/v/vnew
VMODULES: OK, value: /home/delian/.vmodules
VTMP: OK, value: /tmp/v_1000

Git version: git version 2.42.0
Git vroot status: weekly.2023.39-19-g1476daf8
.git/config present: true

CC version: cc (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0
thirdparty/tcc status: thirdparty-linux-amd64 12f392c3

What did you do?
v -g -o vdbg cmd/v && vdbg a.v

a := [?string('foo'), ?string(none)]!
dump(a)

What did you expect to see?

compiled program that runs

What did you see instead?

==================
/tmp/v_1000/a.946870798248241139.tmp.c:2074: error: cannot convert 'struct _option_string' to 'unsigned char *'
...
==================
(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

Note

You can vote for this issue using the 👍 reaction. More votes increase the issue's priority for developers.

Take into account that only the 👍 reaction counts as a vote.
Only reactions to the issue itself will be counted as votes, not comments.

@spytheman spytheman added Bug This tag is applied to issues which reports bugs. Unit: Compiler Bugs/feature requests, that are related to the V compiler in general. Unit: cgen Bugs/feature requests, that are related to the default C generating backend. labels Sep 29, 2023
@spytheman
Copy link
Member Author

println(a) also does not work.

println( a[0]! ) works.

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. Unit: cgen Bugs/feature requests, that are related to the default C generating backend. Unit: Compiler Bugs/feature requests, that are related to the V compiler in general.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant