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: ',' expected (got ";") #23493

Closed
koplenov opened this issue Jan 16, 2025 · 1 comment · Fixed by #23495
Closed

cgen: error: ',' expected (got ";") #23493

koplenov opened this issue Jan 16, 2025 · 1 comment · Fixed by #23495
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

@koplenov
Copy link
Contributor

koplenov commented Jan 16, 2025

V version: V 0.4.9 f9106a8, press to see full `v doctor` output
V full version V 0.4.9 4fcd94a.f9106a8
OS windows, Њ ©Єа®б®дв Windows 10 Pro 19045 64-а §ап¤­ п
Processor 28 cpus, 64bit, little endian, Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz
Memory 17.79GB/31.86GB
V executable C:\Dev\Progs\v\v.exe
V last modified time 2025-01-16 15:42:53
V home dir OK, value: C:\Dev\Progs\v
VMODULES OK, value: C:\Users\koplenov.vmodules
VTMP OK, value: C:\Users\koplenov\AppData\Local\Temp\v_0
Current working dir OK, value: C:\Dev\Zone\mam_v\treevee\src\ast\repro2
Git version git version 2.42.0.windows.2
V git status weekly.2025.1-67-gf9106a86 (2 commit(s) behind V master)
.git/config present true
cc version N/A
gcc version gcc (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders, r4) 13.2.0
clang version clang version 18.1.2
msvc version N/A
tcc version tcc version 0.9.27 (x86_64 Windows)
tcc git status thirdparty-windows-amd64 b425ac82
emcc version N/A
glibc version N/A

What did you do?
./v -g -o vdbg cmd/v && ./vdbg .\main.v && C:\Dev\Zone\mam_v\treevee\src\ast\repro2\main.exe

module main

pub struct Tree {}

pub type TreeBelt = map[string]fn (input &Tree, belt TreeBelt) []&Tree

pub fn (tree &Tree) processed(){
	mut blet := TreeBelt(map[string]fn (&Tree, TreeBelt) []&Tree{})
	blet['pu pu pu'] = fn (input &Tree, belt TreeBelt) []&Tree {
			return []
	}
}

fn main(){
	tree := Tree{}
	tree.processed()
}

What did you see?

================== C compilation error (from tcc): ==============
cc: C:/Users/koplenov/AppData/Local/Temp/v_0/main.01JHRNSK81CK9BS4AHWMB17CZR.tmp.c:3934: warning: implicit declaration of function 'tcc_backtrace'
cc: C:/Users/koplenov/AppData/Local/Temp/v_0/main.01JHRNSK81CK9BS4AHWMB17CZR.tmp.c:6528: error: ',' expected (got ";")
... (the original output was 3 lines long, and was truncated to 2 lines)
=================================================================
(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 .

What did you expect to see?

Successful compilation

If you delete this code:

blet['pu pu pu'] = fn (input &Tree, belt TreeBelt) []&Tree {
	return []
}

it compiles

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.

Copy link

Connected to Huly®: V_0.6-21922

@felipensp felipensp self-assigned this Jan 17, 2025
@felipensp felipensp added 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. labels Jan 17, 2025
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