Open gthvn1 opened 9 months ago
I was just playing with V to discover the language that I found really interesting so my code is probably wrong but it seems that there is a bug in the compiler so I reported the issue as asked in the output log :). The code is available here : https://github.com/gthvn1/vervet/tree/bug_report It is more a playground but it seems that I messed with module..
Hope this will help,
I cloned your project and tried it based on the information you provided, but I couldn't reproduce the problem, everything works for me. I'm on Ubuntu 23.10 and I used tcc / gcc and clang for the test.
Maybe because I'm on Ubuntu?
Have other people managed to reproduce the problem?
@GGRei thanks for trying to reproduce :+1: . you tried with the branch bug_report
I guess? The other point that maybe is not clear is that if I run v run .
at the toplevel of the repository it is working. But if I run it in the src/
directory then I see the issue reported.
Note that to fix that (as I continue to test) I just moved the v.mod
to src/
and it works. So I think that the error is because I don't use tool as expected but as it generates an error when compiling to C code maybe it is interesting.
@gthvn1 Okay! I didn't realize you were using the v run .
command.
Ok, I do see the problem now. Thank you for the additional information!
Running with clang it shows:
/tmp/v_1000/vervet.01HT5PYW7BQ3NTNS1J0GMAB6ZD.tmp.c:684:3: error: unknown type name 'MessageError'
MessageError* _MessageError;
^
/tmp/v_1000/vervet.01HT5PYW7BQ3NTNS1J0GMAB6ZD.tmp.c:688:2: error: unknown type name 'string'
string* msg;
^
/tmp/v_1000/vervet.01HT5PYW7BQ3NTNS1J0GMAB6ZD.tmp.c:703:2: error: unknown type name 'ArrayFlags'
ArrayFlags flags;
^
/tmp/v_1000/vervet.01HT5PYW7BQ3NTNS1J0GMAB6ZD.tmp.c:724:2: error: must use 'struct' tag to refer to type 'DenseArray'
DenseArray key_values;
^
V doctor:
What did you do?
v -g -o vdbg cmd/v && vdbg main.v
What did you expect to see?
Hello sailor!!!
What did you see instead?