You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tcc version 0.9.28rc 2024-02-05 HEAD@105d70f7 (AArch64 Darwin)
tcc git status
thirdparty-macos-arm64 713692d4
emcc version
N/A
glibc version
N/A
What did you do? ./v -g -o vdbg cmd/v && ./vdbg /Users/adamoates/Documents/test.v && /Users/adamoates/Documents/test
@[heap]
structFoo {
mut:
val int
}
@[heap]
structBar {
mut:
val int
}
interfaceFooBar {
mut:
val int
}
fnmain() {
mutfbs:= []&FooBar{}
fbs <<&Foo{1}
do_something:=fn [mut fbs] () {
_:= fbs.last() asFoo// this line works outside of anon fn
}
do_something()
}
What did you see?
================== C compilation error (from cc): ==============
cc: /tmp/v_501/test.01JJ070E9Q2AMPY8P60M3QA2DT.tmp.c:1901:131: error: call to undeclared function 'v_typeof_interface_idx_main__FooBar'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
cc: 1901 | {main__Foo _ = ({ main__FooBar* _t1 = (*(main__FooBar**)array_last(_V_closure_ctx->fbs)); *(main__Foo*)__as_cast(_t1->_main__Foo,v_typeof_interface_idx_main__FooBar(_t1->_typ), 103); });}
cc: | ^
cc: /tmp/v_501/test.01JJ070E9Q2AMPY8P60M3QA2DT.tmp.c:1901:131: note: did you mean 'v_typeof_interface_main__FooBar'?
cc: /tmp/v_501/test.01JJ070E9Q2AMPY8P60M3QA2DT.tmp.c:1131:15: note: 'v_typeof_interface_main__FooBar' declared here
cc: 1131 | static char * v_typeof_interface_main__FooBar(int sidx);
cc: | ^
cc: 1 error generated.
================================================================
(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 .
What did you expect to see?
Expected code to compile.
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.
V version: V 0.4.9 f9d3bd3, press to see full `v doctor` output
What did you do?
./v -g -o vdbg cmd/v && ./vdbg /Users/adamoates/Documents/test.v && /Users/adamoates/Documents/testWhat did you see?
What did you expect to see?
Expected code to compile.
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.