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
./koch.py tests --targets:c r tests/lang_experimental/views/tprocedural_views.nim
Actual Output
FAIL: tests/lang_experimental/views/tprocedural_views.nim c ( 0.18 sec)
Test "tests/lang_experimental/views/tprocedural_views.nim" in category "lang_experimental"
Failure: reNimcCrash
debugInfo: compiler exit code was 1 but no Error's were found.
$ nimskull/bin/nim c --hints:on -d:testing --clearNimblePath --nimblePath:build/deps/pkgs --nimCache:nimcache/tests/lang_experimental/views/tprocedural_views.nim_4a8a08f09d37b73795649038408b5f33 tests/lang_experimental/views/tprocedural_views.nim
nimskull/nimcache/tests/lang_experimental/views/tprocedural_views.nim_4a8a08f09d37b73795649038408b5f33/@mtprocedural_views.nim.c: In function ‘NimMainModule’:
nimskull/nimcache/tests/lang_experimental/views/tprocedural_views.nim_4a8a08f09d37b73795649038408b5f33/@mtprocedural_views.nim.c:135:19: error: assignment to ‘NI (**)(NI)’ {aka ‘long int (**)(long int)’} from incompatible pointer type ‘tyProc__AUU7JKzv059aLg8CDEB5NOw’ {aka ‘long int (*)(long int)’} [-Wincompatible-pointer-types]
135 | _7.Field0 = _6;
| ^
execution of an external program 'gcc -c -w -fmax-errors=3 -Inimskull/lib -Inimskull/tests/lang_experimental/views -o nimskull/nimcache/tests/lang_experimental/views/tprocedural_views.nim_4a8a08f09d37b73795649038408b5f33/@mtprocedural_views.nim.c.o nimskull/nimcache/tests/lang_experimental/views/tprocedural_views.nim_4a8a08f09d37b73795649038408b5f33/@mtprocedural_views.nim.c' failed with exit code '1'
The text was updated successfully, but these errors were encountered:
The problem lies in line 35, with the minimal reproducer being:
typeProc=proc (x: int): int {.nimcall.}
Obj=object
tup: (lentProc,)
let
p =proc(x: int): int= x
o =Obj(tup: (p,))
As can be seen in the (shortened) --showir:transf output:
0 N:LetSection
0 N:IdentDefs
0 N:Sym "o" sk:skLet
1 N:Empty
2 N:ObjConstr
0 N:Sym "Obj" sk:skType
1 N:ExprColonExpr
0 N:Sym "tup" sk:skField
offset: 0
1 N:TupleConstr
0 N:Sym "p" sk:skLet # <- this is the important part
The HiddenAddr operation for creating a view of p is missing, meaning that a function pointer is assigned to a location expecting a pointer to a function pointer.
Example
Actual Output
The text was updated successfully, but these errors were encountered: