V: Compiler panic when returning a generic struct

Created on 20 Aug 2020  路  3Comments  路  Source: vlang/v

V version: 0.1.29 9b171b7
OS: Windows 10 v2004

What did you do?

struct St<T> {
}

fn main() {
    _ := new<int>()
}

fn new<T>() St<T> {
    return St<T>{}
}

What did you expect to see?
Nothing, this should compiler and run

What did you see instead?
The compiler panicked (see https://im.farfrom.world/dvzekithsj.png)

Bug

All 3 comments

hmm, for me, on the latest commit of V compiled and ran it without any problems

hmm, for me, on the latest commit of V compiled and ran it without any problems

Looks like github stripped some of my code... https://im.farfrom.world/irkpvnywxb.png
Try running this: https://hst.sh/ikobaciquj.cpp

Use triple backticks and newlines for correct formatting.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

radare picture radare  路  3Comments

PavelVozenilek picture PavelVozenilek  路  3Comments

cjmxp picture cjmxp  路  3Comments

elimisteve picture elimisteve  路  3Comments

arg2das picture arg2das  路  3Comments