Open remdragon opened 1 year ago
Add the -g
option to your V compile line.
Doesn't look any different to me:
C:\cvs\itas\openai_expert>v -g run bug.v
V panic: array.get: index out of range (i == 16777236, a.len == 232)
v hash: 0fc33c6
C:/Users/royce3/AppData/Local/Temp/v_0/v2.8592022617382340753.tmp.c:21370: at _v_panic: Backtrace
C:/Users/royce3/AppData/Local/Temp/v_0/v2.8592022617382340753.tmp.c:20848: by array_get
C:/Users/royce3/AppData/Local/Temp/v_0/v2.8592022617382340753.tmp.c:16384: by anon_fn_48bf088567a1e8f8_v__ast__structfield__bool_8445
C:/Users/royce3/AppData/Local/Temp/v_0/v2.8592022617382340753.tmp.c:1980: by v__checker__Checker_fetch_and_verify_orm_fields
C:/Users/royce3/AppData/Local/Temp/v_0/v2.8592022617382340753.tmp.c:1867: by v__checker__Checker_sql_stmt_line
C:/Users/royce3/AppData/Local/Temp/v_0/v2.8592022617382340753.tmp.c:1770: by v__checker__Checker_sql_stmt
C:/Users/royce3/AppData/Local/Temp/v_0/v2.8592022617382340753.tmp.c:55921: by v__checker__Checker_stmt
C:/Users/royce3/AppData/Local/Temp/v_0/v2.8592022617382340753.tmp.c:56367: by v__checker__Checker_stmts_ending_with_expression
C:/Users/royce3/AppData/Local/Temp/v_0/v2.8592022617382340753.tmp.c:56343: by v__checker__Checker_stmts
C:/Users/royce3/AppData/Local/Temp/v_0/v2.8592022617382340753.tmp.c:62055: by v__checker__Checker_fn_decl
C:/Users/royce3/AppData/Local/Temp/v_0/v2.8592022617382340753.tmp.c:55881: by v__checker__Checker_stmt
C:/Users/royce3/AppData/Local/Temp/v_0/v2.8592022617382340753.tmp.c:54071: by v__checker__Checker_check
C:/Users/royce3/AppData/Local/Temp/v_0/v2.8592022617382340753.tmp.c:54138: by v__checker__Checker_check_files
C:/Users/royce3/AppData/Local/Temp/v_0/v2.8592022617382340753.tmp.c:42491: by v__builder__Builder_middle_stages
C:/Users/royce3/AppData/Local/Temp/v_0/v2.8592022617382340753.tmp.c:42522: by v__builder__Builder_front_and_middle_stages
C:/Users/royce3/AppData/Local/Temp/v_0/v2.8592022617382340753.tmp.c:45370: by v__builder__cbuilder__gen_c
C:/Users/royce3/AppData/Local/Temp/v_0/v2.8592022617382340753.tmp.c:45353: by v__builder__cbuilder__build_c
C:/Users/royce3/AppData/Local/Temp/v_0/v2.8592022617382340753.tmp.c:45343: by v__builder__cbuilder__compile_c
C:/Users/royce3/AppData/Local/Temp/v_0/v2.8592022617382340753.tmp.c:45245: by v__builder__Builder_rebuild
C:/Users/royce3/AppData/Local/Temp/v_0/v2.8592022617382340753.tmp.c:43975: by v__builder__compile
C:/Users/royce3/AppData/Local/Temp/v_0/v2.8592022617382340753.tmp.c:45691: by main__rebuild
C:/Users/royce3/AppData/Local/Temp/v_0/v2.8592022617382340753.tmp.c:45578: by main__main
C:/Users/royce3/AppData/Local/Temp/v_0/v2.8592022617382340753.tmp.c:46692: by wmain
00a88220 : by ???
00a88383 : by ???
That tells you the problem isn't in your code, it's in the compiler.
This problem is related to the lack of support for optional fields in the ORM. I have been working on it for some time, but I encountered issues with the database libraries. Once I resolve those issues, I will be able to complete this task. Therefore, it is not advisable to close it at this time. I will also update the issue name for better accuracy.
Is this is issue yet reproducible with latest version?
Describe the bug
I'm getting a panic that doesn't tell me what or even where the problem is in my code
Expected Behavior
An error message that tells me what's wrong
Current Behavior
Reproduction Steps
v run bug.v .
Here's bug.v:
Possible Solution
no idea
Additional Information/Context
I'm guessing this might have to do with defining the name field as ?string, I'm trying to specify that this field should be nullable. I see in the ORM documentation that there is a [nonull] flag, which probably means that fields are nullable by default, but I think that if I don't define [nonull] that the proper type of the field should be ?string.
V version
V 0.3.4 0fc33c6
Environment details (OS name and version, etc.)