Skip to content

defect &Object{}.aย #22688

Closed
Closed

Description

@markfirmware

V doctor:

V full version: V 0.4.8 df4c6ac.5d76ee4
OS: linux, Debian GNU/Linux 12 (bookworm) (VM)
Processor: 1 cpus, 64bit, little endian, DO-Premium-AMD

getwd: /home/user/github.com/markfirmware/vlister/src
vexe: /home/user/github.com/vlang/v/v
vexe mtime: 2024-10-28 20:57:38

vroot: OK, value: /home/user/github.com/vlang/v
VMODULES: OK, value: /home/user/.vmodules
VTMP: OK, value: /tmp/v_1000

Git version: git version 2.39.5
Git vroot status: weekly.2024.43-58-g5d76ee46
.git/config present: true

CC version: cc (Debian 12.2.0-14) 12.2.0
thirdparty/tcc status: thirdparty-linux-amd64 0134e9b9

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

struct Object {
  a int
}

fn main() {
  field := &Object{}.a
  println('${field}')
}

What did you expect to see?

compile ok

What did you see instead?

================== C compilation error (from tcc): ==============
cc: /tmp/v_1000/field_ref_main.01JBAEQVFERFTWSV304MH6SME1.tmp.c:13476: error: lvalue expected
=================================================================
(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 .

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.

Hulyยฎ: V_0.6-21137

Activity

  1. added
    BugThis tag is applied to issues which reports bugs.
    Status: ConfirmedThis bug has been confirmed to be valid by a contributor.
    Unit: cgenBugs/feature requests, that are related to the default C generating backend.
    on Oct 28, 2024
  2. self-assigned this
    on Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugThis tag is applied to issues which reports bugs.Status: ConfirmedThis bug has been confirmed to be valid by a contributor.Unit: cgenBugs/feature requests, that are related to the default C generating backend.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions