v icon indicating copy to clipboard operation
v copied to clipboard

compilation error for displaying map of references of generic types

Open yungchinghsiao opened this issue 2 years ago • 0 comments

Describe the bug

The following code is getting a compilation error:

import datatypes
fn main() {
        mut m := map[string]&datatypes.Queue[i64]{}
        println("${m}")
}

Expected Behavior

The code should compile cleanly.

Current Behavior

v fails with the following errors:

/tmp/v_5014/map.647552516261589458.tmp.c:2214: error: cannot convert 'struct datatypes__Queue_T_i64 *' to 'struct datatypes__Queue_T_i64'
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

v run bug.v

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.3.3 3c23a7e

Environment details (OS name and version, etc.)

OS: linux, "CentOS Linux release 7.9.2009 (Core)" Processor: 8 cpus, 64bit, little endian, Intel(R) Xeon(R) CPU E3-1231 v3 @ 3.40GHz CC version: cc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)

V full version: V 0.3.3 5454562.3c23a7e

Git vroot status: weekly.2023.09-25-g3c23a7eb-dirty thirdparty/tcc status: thirdparty-linux-amd64 12f392c3-dirty

yungchinghsiao avatar Mar 03 '23 16:03 yungchinghsiao