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

[builder error] match + & #21856

Closed
russo-2025 opened this issue Jul 12, 2024 · 0 comments · Fixed by #21874
Closed

[builder error] match + & #21856

russo-2025 opened this issue Jul 12, 2024 · 0 comments · Fixed by #21874
Labels
Bug This tag is applied to issues which reports bugs. Unit: Checker Bugs/feature requests, that are related to the type checker.

Comments

@russo-2025
Copy link

russo-2025 commented Jul 12, 2024

Describe the bug

==================
C:/Users/russo/AppData/Local/Temp/v_0/bug1.01J2KZSNTGBA77PHH8BD7V62CY.tmp.c:6979: warning: implicit declaration of function 'tcc_backtrace'
C:/Users/russo/AppData/Local/Temp/v_0/bug1.01J2KZSNTGBA77PHH8BD7V62CY.tmp.c:13360: error: lvalue expected
...
==================
(Use `v -cg` to print the entire error message)

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 .

C:\Users\russo\Desktop\vbugs>v run bug1.v
==================
C:/Users/russo/AppData/Local/Temp/v_0/bug1.01J2KZWH3Z9FQ7DWEPSBXQMSBC.tmp.c:6979: warning: implicit declaration of function 'tcc_backtrace'
C:/Users/russo/AppData/Local/Temp/v_0/bug1.01J2KZWH3Z9FQ7DWEPSBXQMSBC.tmp.c:13360: error: lvalue expected
...
==================
(Use `v -cg` to print the entire error message)

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 .

Reproduction Steps

module main

pub struct Expr1 {}
pub struct Expr2 {}

pub type Expr = Expr1 | Expr2

pub struct Gen {
}

fn (mut g Gen) foo(mut expr &Expr1) {
}

pub fn (mut g Gen) bar(mut expr &Expr) {
	match mut expr {
		Expr1 { g.foo(mut &expr) } // <--- &
		Expr2 {}
	}
}

fn main() {
}

Expected Behavior

ok

Current Behavior

builder error

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.6 7908957

Environment details (OS name and version, etc.)

V full version: V 0.4.6 58a8fc6.7908957
OS: windows, Windows 10 Pro v19042 64-bit
Processor: 16 cpus, 64bit, little endian,

getwd: M:_projects_skyrim\papyrus-compiler
vexe: M:_dev\vlang\v.exe
vexe mtime: 2024-07-12 16:28:32

vroot: OK, value: M:_dev\vlang
VMODULES: OK, value: C:\Users\russo.vmodules
VTMP: OK, value: C:\Users\russo\AppData\Local\Temp\v_0

Git version: git version 2.45.1.windows.1
Git vroot status: weekly.2024.20-247-g79089578
.git/config present: true

CC version: Error: 'cc' is not recognized as an internal or external command,
operable program or batch file.

thirdparty/tcc: N/A

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.

@russo-2025 russo-2025 added the Bug This tag is applied to issues which reports bugs. label Jul 12, 2024
@felipensp felipensp added the Unit: Checker Bugs/feature requests, that are related to the type checker. label Jul 12, 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. Unit: Checker Bugs/feature requests, that are related to the type checker.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants