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

cgen error: assign the spawn or go expr to the []thread #19365

Closed
shove70 opened this issue Sep 16, 2023 · 0 comments · Fixed by #19366
Closed

cgen error: assign the spawn or go expr to the []thread #19365

shove70 opened this issue Sep 16, 2023 · 0 comments · Fixed by #19366
Assignees
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@shove70
Copy link
Contributor

shove70 commented Sep 16, 2023

Describe the bug

v run a.v
==================
/tmp/v_501/a.12000158363956472078.tmp.c:2138:8: error: expected ';' at end of declaration
        int a1 });
              ^
              ;
/tmp/v_501/a.12000158363956472078.tmp.c:2138:10: error: expected identifier or '('
        int a1 });
                ^
/tmp/v_501/a.12000158363956472078.tmp.c:2139:20: error: expected ')'
         _v_dump_expr_int(_SLIT("a.v"), 6, _SLIT("a"), a);
                          ^
/tmp/v_501/a.12000158363956472078.tmp.c:183:27: note: expanded from macro '_SLIT'
#define _SLIT(s) ((string){.str=(byteptr)("" s), .len=(sizeof(s)-1), .is_lit=1})
...
==================
(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

Reproduction Steps

fn main() {
	mut threads := []thread{len: 1}

	threads[0] = spawn fn () {
		a := 1
		dump(a)
		assert true
	}()

	threads.wait()
}

Expected Behavior

no error.

Current Behavior

cgen error.

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.1 09006fa

Environment details (OS name and version, etc.)

V full version: V 0.4.1 09006fa
OS: macos, macOS, 13.5.2, 22G91
Processor: 8 cpus, 64bit, little endian, Intel(R) Core(TM) i7-8569U CPU @ 2.80GHz

getwd: /usr/local/v
vexe: /usr/local/v/v
vexe mtime: 2023-09-16 08:46:34

vroot: OK, value: /usr/local/v
VMODULES: OK, value: /Users/shove/.vmodules
VTMP: OK, value: /tmp/v_501

Git version: git version 2.39.2 (Apple Git-143)
Git vroot status: weekly.2023.30-315-g09006fa5
.git/config present: true

CC version: Apple clang version 14.0.3 (clang-1403.0.22.14.1)
thirdparty/tcc status: thirdparty-macos-amd64 46662e2

Important

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.

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