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

Alias to sum type with enum builder error #19407

Closed
lv37 opened this issue Sep 21, 2023 · 0 comments · Fixed by #19423
Closed

Alias to sum type with enum builder error #19407

lv37 opened this issue Sep 21, 2023 · 0 comments · Fixed by #19423
Labels
Bug This tag is applied to issues which reports bugs. Build V build error on any OS/CPU architecture. Unit: Compiler Bugs/feature requests, that are related to the V compiler in general. Unit: Type System Bugs/feature requests, that are related to the V types system.

Comments

@lv37
Copy link
Contributor

lv37 commented Sep 21, 2023

Describe the bug

I get /tmp/v_1002/main.9579099472038226446.tmp.c:2078: error: field expected when trying to compile the following code:

module main

enum Test {
	abc
}

type SumTest = Test | u8

type TestAlias = Test

fn main() {
	use_test(TestAlias.abc)
}

fn use_test(t SumTest) {}

Reproduction Steps

compile the above code

Expected Behavior

compile

Current Behavior

/tmp/v_1002/main.9579099472038226446.tmp.c:2078: error: field expected
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

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.1 5ddbbfc

Environment details (OS name and version, etc.)

V full version: V 0.4.1 f93d257.5ddbbfc
OS: linux, Linux version 6.4.15-200.fc38.x86_64 (mockbuild@2e6cd98d8465441c8330a02794035256) (gcc (GCC) 13.2.1 20230728 (Red Hat 13.2.1-1), GNU ld version 2.39-9.fc38) #1 SMP PREEMPT_DYNAMIC Thu Sep  7 00:25:01 UTC 2023
Processor: 4 cpus, 64bit, little endian, Intel(R) Core(TM) i5-4310U CPU @ 2.00GHz

getwd: /home/user/Projects/v-testing/mineflayer
vexe: /home/user/.local/lib/v/v
vexe mtime: 2023-09-21 17:57:08

vroot: OK, value: /home/user/.local/lib/v
VMODULES: OK, value: /home/user/.vmodules
VTMP: OK, value: /tmp/v_1002

Git version: git version 2.41.0
Git vroot status: weekly.2023.38-18-g5ddbbfcf
.git/config present: true

CC version: cc (GCC) 13.2.1 20230728 (Red Hat 13.2.1-1)
thirdparty/tcc status: thirdparty-linux-amd64 12f392c3

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.

@lv37 lv37 added the Bug This tag is applied to issues which reports bugs. label Sep 21, 2023
@ArtemkaKun ArtemkaKun added Unit: Compiler Bugs/feature requests, that are related to the V compiler in general. Unit: Type System Bugs/feature requests, that are related to the V types system. Build V build error on any OS/CPU architecture. labels Sep 22, 2023
lv37 added a commit to lv37/v that referenced this issue Sep 23, 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: Compiler Bugs/feature requests, that are related to the V compiler in general. 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.

2 participants