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: cannot convert 'struct array' to 'struct string *' #22315

Closed
trondsg opened this issue Sep 26, 2024 · 0 comments · Fixed by #22317
Closed

C error: cannot convert 'struct array' to 'struct string *' #22315

trondsg opened this issue Sep 26, 2024 · 0 comments · Fixed by #22317
Assignees
Labels
Bug This tag is applied to issues which reports bugs. Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: cgen Bugs/feature requests, that are related to the default C generating backend.

Comments

@trondsg
Copy link

trondsg commented Sep 26, 2024

V doctor:

V full version: V 0.4.7 7baff15

CC version: cc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
thirdparty/tcc: N/A

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

type Either = string | int

fn tag(params ...Either) int {
	return 0
}

fn div(params ...Either) int {
	return tag(params)
}

What did you expect to see?

compilation complete ok

What did you see instead?

================== C compilation error (from tcc): ==============
cc: /tmp/v_1000/liveview_bug.01J8NVCRNQZEBSJ5FMBMQZ2DW7.tmp.c:13255: error: cannot convert 'struct array' to 'struct string *'
=================================================================
(You can pass `-cg`, or `-show-c-output` as well, to print all the C error messages).
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 .

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.

@felipensp felipensp self-assigned this Sep 26, 2024
@felipensp felipensp added Bug This tag is applied to issues which reports bugs. Unit: cgen Bugs/feature requests, that are related to the default C generating backend. labels Sep 26, 2024
@felipensp felipensp added the Status: Confirmed This bug has been confirmed to be valid by a contributor. label Sep 26, 2024
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. Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: cgen Bugs/feature requests, that are related to the default C generating backend.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants