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
The code should compile successfully regardless of the declaration order.
Current Behavior
The compiler crashes with the following panic:
V panic: table.sym: invalid type (typ=ast.Type(0x0 = 0) idx=0). Compiler bug. This should never happen. Please report the bug using `v bug file.v`.
v hash: d9f1e33
pid: 0xc2127
tid: 0xc2132
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:19978: at builtin___v_panic: Backtrace
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:37647: by v__ast__default_table_panic_handler
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:37653: by v__ast__Table_panic
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:38355: by v__ast__Table_sym
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:33408: by v__gen__c__Gen_expr_with_cast
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:55586: by v__gen__c__Gen_zero_struct_field
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:55369: by v__gen__c__Gen_struct_init
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:34569: by v__gen__c__Gen_expr
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:34565: by v__gen__c__Gen_expr
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:33564: by v__gen__c__Gen_expr_with_cast
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:37413: by v__gen__c__Gen_return_stmt
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:33000: by v__gen__c__Gen_stmt
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:32664: by v__gen__c__Gen_stmts_with_tmp_var
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:32503: by v__gen__c__Gen_stmts
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:43235: by v__gen__c__Gen_gen_fn_decl
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:42877: by v__gen__c__Gen_gen_fn_decl
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:42786: by v__gen__c__Gen_fn_decl
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:32888: by v__gen__c__Gen_stmt
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:32664: by v__gen__c__Gen_stmts_with_tmp_var
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:32503: by v__gen__c__Gen_stmts
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:31309: by v__gen__c__Gen_gen_file
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:31248: by v__gen__c__cgen_process_one_file_cb
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:33656: by sync__pool__process_in_thread
/tmp/v_1000/v2.01KBHPZTRSRMD1X332H4ZCPK7B.tmp.c:16430: by sync__pool__process_in_thread_thread_wrapper
0x7f2945c9698b: by ???
Possible Solution
No response
Additional Information/Context
No response
V version
V 0.4.12 d9f1e33
Environment details (OS name and version, etc.)
V 0.4.12 d9f1e33
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.
Describe the bug
The compiler panic when instantiating a generic struct. The panic occurs under a specific combination of conditions:
struct Queue[T]) is defined after the function (some_func) that instantiates it&Speaker,&Event, or&T)If I change the field type to a concrete struct reference (e.g.,
&Cat) or move the struct definition before the usage, the code compiles successfully.Reproduction Steps
Expected Behavior
The code should compile successfully regardless of the declaration order.
Current Behavior
The compiler crashes with the following panic:
Possible Solution
No response
Additional Information/Context
No response
V version
V 0.4.12 d9f1e33
Environment details (OS name and version, etc.)
V 0.4.12 d9f1e33
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.