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 when trying to print variadic list #19490

Closed
JalonSolov opened this issue Oct 1, 2023 · 2 comments · Fixed by #19503
Closed

C error when trying to print variadic list #19490

JalonSolov opened this issue Oct 1, 2023 · 2 comments · Fixed by #19503
Labels
Bug This tag is applied to issues which reports bugs. Build V build error on any OS/CPU architecture. Unit: Checker Bugs/feature requests, that are related to the type checker. Unit: Type System Bugs/feature requests, that are related to the V types system.

Comments

@JalonSolov
Copy link
Contributor

JalonSolov commented Oct 1, 2023

V doctor:

V full version: V 0.4.2 72cd9b8.6bd4539
OS: linux, "Manjaro Linux"
Processor: 32 cpus, 64bit, little endian, AMD Ryzen 9 7950X 16-Core Processor

getwd: /home/jalon
vexe: /home/jalon/git/v/v
vexe mtime: 2023-10-01 19:35:15

vroot: OK, value: /home/jalon/git/v
VMODULES: OK, value: /home/jalon/.vmodules
VTMP: OK, value: /tmp/v_1000

Git version: git version 2.42.0
Git vroot status: 0.4.2-12-g6bd45394
.git/config present: true

CC version: cc (GCC) 13.2.1 20230801
thirdparty/tcc status: json2_perf 12f392c3

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

fn main() {
	a := 23
	b := 87
	c := 98
	d := 125
	e := [a, b, c, d]
	println(...e)
}

What did you expect to see?

Compile clean and print output

What did you see instead?

==================
/tmp/v_1000/bug.8127757580338853967.tmp.c:12446: error: cannot convert 'struct array' to 'int'
...
==================
(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.

@JalonSolov JalonSolov added the Bug This tag is applied to issues which reports bugs. label Oct 1, 2023
@ArtemkaKun ArtemkaKun added Unit: Type System Bugs/feature requests, that are related to the V types system. Unit: cgen Bugs/feature requests, that are related to the default C generating backend. Build V build error on any OS/CPU architecture. labels Oct 2, 2023
@Delta456
Copy link
Member

Delta456 commented Oct 2, 2023

In Go, you cannot print a variadic list. I personally haven't seen any language which allows printing a variadic.

image

@Delta456
Copy link
Member

Delta456 commented Oct 3, 2023

After discussing with people on the discord server, it shouldn't work and this should be an error instead.

@Delta456 Delta456 added Unit: Checker Bugs/feature requests, that are related to the type checker. and removed Unit: cgen Bugs/feature requests, that are related to the default C generating backend. labels Oct 3, 2023
spytheman pushed a commit that referenced this issue Oct 4, 2023
Wertzui123 pushed a commit to Wertzui123/v that referenced this issue Oct 8, 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. Build V build error on any OS/CPU architecture. Unit: Checker Bugs/feature requests, that are related to the type checker. Unit: Type System Bugs/feature requests, that are related to the V types system.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants