vlang / v

Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io
MIT License
35.8k stars 2.16k forks source link

Compiler error when asserting net.Addr #9505

Closed inxomnyaa closed 1 month ago

inxomnyaa commented 3 years ago

V version: 0.2.2 OS: Windows 10 20H2

What did you do? I created a struct that holds a net.Addr and some other values. See https://github.com/WolvesFortress/VRakLib/blob/rewrite/open_connection_request2.v

After that i tried to assert 2 OpenConnectionRequest2 structs and got a compiler error.

What did you expect to see? Assert failing or passing (i compared 127.0.0.1:54132 to 128.255.255.244:54132 because my address decode was asymmetrical)

What did you see instead? The generated C code created an additional struct in the sockaddr compare function

static bool struct sockaddr_struct_eq(struct sockaddr a, struct sockaddrb) {
if (a.sa_family != b.sa_family) {
return false;
}
return true;
}
felipensp commented 1 month ago

Is this still an issue?

inxomnyaa commented 1 month ago

I actually have no clue, i've moved on from working with this language due to all these minor annoyances

felipensp commented 1 month ago

You can help us make V better. V has been improved on every day. So each bug report is important to increate V consistency base through its tests.

I'm closing this report due no real reproducible test case provided. If you still having the real code which triggers the bug, feel free to post here.

Thanks.

medvednikov commented 1 month ago

It's definitely not an issue anymore.