aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors
AgeCommit message (Collapse)Author
2022-09-27Sema: fix segfault when union init with empty fieldkkHAIKE
2022-09-25sema: load the correct AST in addFieldErrNoteJohn Schmidt
The enum we want to get the fields from might not be declared in the same file as the block we are analyzing, so we should get the AST from the decl's file instead. Closes #12950.
2022-09-23Sema: correct sentinel check on implicit cast from array ptrVeikka Tuominen
Closes #12938
2022-09-23Sema: check for slices in packed and extern type validationVeikka Tuominen
Closes #12930
2022-09-21AstGen: store void to ptr result loc when there is no else branchkkHAIKE
2022-09-21AstGen: make loop body's ResultLoc .nonekkHAIKE
Fixes #12555 Fixes #12551 Fixes #12455
2022-09-21sema: fix typoJacob Young
2022-09-20std: add return address parameter to panic fnVeikka Tuominen
2022-09-20Sema: validate `@alignOf` typeVeikka Tuominen
2022-09-20Sema: check pointer qualifiers before implicit castVeikka Tuominen
Closes #12881
2022-09-19Sema: do not use coerceCompatiblePtr for ptrCastVeikka Tuominen
2022-09-17test-cases: remove removed "note: referenced here" note from the errorJakub Konka
2022-09-16Merge pull request #12796 from Vexu/referenced-by-v2Veikka Tuominen
stage2: add referenced by trace to compile errors attempt #2 (+ some fixes)
2022-09-16Sema: improve source location after as_node is usedAndrew Kelley
+2 more passing compile error tests
2022-09-15organize some compile error testsAndrew Kelley
Many of these tests check for the incorrect behavior of stage1 whereas self-hosted correctly does not emit an error, so they are simply deleted. The remaining number of test cases within the stage1/ subdirectory is reduced from 143 to 103.
2022-09-15stage2: implement referenced by trace for error messagesVeikka Tuominen
Closes #7668 Closes #12141
2022-09-15Sema: check_comptime_control_flow needs to check runtime_indexVeikka Tuominen
2022-09-15Sema: copy runtime_index & friends when making child blocksVeikka Tuominen
2022-09-13validate number literals in AstGenVeikka Tuominen
2022-09-13add compile error test for pointless discardsAndrew Kelley
2022-09-13remove pointless discards in test casesAndrew Kelley
2022-09-12stage2: change how defers are stored in ZirVeikka Tuominen
Storing defers this way has the benefits that the defer doesn't get analyzed multiple times in AstGen, it takes up less space, and it makes Sema aware of defers allowing for 'unreachable else prong' error on error sets in generic code. The disadvantage is that it is a bit more complex and errdefers with payloads now emit a placeholder instruction (but those are rare). Sema.zig before: Total ZIR bytes: 3.7794370651245117MiB Instructions: 238996 (2.051319122314453MiB) String Table Bytes: 89.2802734375KiB Extra Data Items: 430144 (1.640869140625MiB) Sema.zig after: Total ZIR bytes: 3.3344192504882812MiB Instructions: 211829 (1.8181428909301758MiB) String Table Bytes: 89.2802734375KiB Extra Data Items: 374611 (1.4290275573730469MiB)
2022-09-10type: print comptime on fn type paramsJacob Young
This avoids the following confusing error message: error: expected type 'fn(i32, i32) void', found 'fn(i32, i32) void'
2022-09-08Sema: fix UAF in zirClosureGetVeikka Tuominen
Previously if a decl failed its capture scope would be deallocated and set to undefined which would then lead to invalid dereference in `zirClosureGet`. To avoid this set the capture scope to a special failed state and fail the current decl with dependency failure if the failed state is encountered in `zirClosureGet`. Closes #12433 Closes #12530 Closes #12593
2022-09-08Sema: correct types in `@memset` and `@memcpy`Veikka Tuominen
Closes #12750
2022-09-03Sema: only ABI sized packed structs are extern compatibleVeikka Tuominen
2022-09-02Sema: improve behavior of comptime_int backed enumsVeikka Tuominen
2022-09-02Sema: add error for enum tag value overflowVeikka Tuominen
Closes #12291
2022-09-02Sema: fix noalias coercion error messageVeikka Tuominen
Closes #11769
2022-09-02AstGen: use reachableExpr for try operandVeikka Tuominen
Closes #12248
2022-09-01Sema: add more validation to coerceVarArgParamVeikka Tuominen
Closes #12706
2022-08-30Sema: shift of comptime int with runtime valueVeikka Tuominen
Closes #12290
2022-08-30Sema: do not emit generic poison for non generic parametersVeikka Tuominen
Closes #12679
2022-08-30Sema: improve handling of always_tail call modifierVeikka Tuominen
Closes #4301 Closes #5692 Closes #6281 Closes #10786 Closes #11149 Closes #11776
2022-08-29Sema: fix access of inactive union field when enum and union fields are in ↵Veikka Tuominen
different order Closes #12667
2022-08-28add error tests for now correctly behaving casesVeikka Tuominen
Closes #6377
2022-08-28Sema: add error for switch on sliceVeikka Tuominen
Closes #12651
2022-08-28AstGen: add error for named function typeVeikka Tuominen
Closes #12660
2022-08-27Sema: add error for non-comptime param in comptime funcantlilja
Adds error for taking a non comptime parameter in a function returning a comptime-only type but not when that type is dependent on a parameter. Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-08-25Sema: ignore comptime params in partial func type checkVeikka Tuominen
This fixes a bug exposed by cd1833044ab7505bc101c85f59889bd3ea3fac80 where a function type would be converted to generic_poison even after being instantiated due to containing comptime only types. This could also be fixed by just checking `is_generic_instantiation` but this way also provides better type names. Closes #12625
2022-08-24Merge pull request #12623 from Vexu/stage2-fixesAndrew Kelley
Stage2 fixes
2022-08-24Merge pull request #12574 from Vexu/remove-bit-op-type-paramAndrew Kelley
stage2+stage1: remove type parameter from bit builtins
2022-08-24Sema: correctly reset inst_map for analyzeInlineCallArgVeikka Tuominen
Closes #12622
2022-08-24Sema: fix crash on slice of non-array typeVeikka Tuominen
Closes #12621
2022-08-24Sema: do not construct nested partial function typesVeikka Tuominen
Closes #12616
2022-08-22Sema: fix fieldCallBind on tuples and anon structsVeikka Tuominen
Closes #12573
2022-08-22stage2+stage1: remove type parameter from bit builtinsVeikka Tuominen
Closes #12529 Closes #12511 Closes #6835
2022-08-22Sema: fix parameter of type 'T' must be comptime errorVeikka Tuominen
Closes #12519 Closes #12505
2022-08-21Sema: add note about function call being comptime because of comptime only ↵Veikka Tuominen
return type
2022-08-18AstGen: disallow leading zeroes in int literals and int typeszooster
This makes `0123` and `u0123` etc. illegal. I'm now confident that this is a good change because I actually caught two C header translation mistakes in `haiku.zig` with this. Clearly, `0123` being octal in C (TIL) can cause confusion, and we make this easier to read by requiring `0o` as the prefix and now also disallowing leading zeroes in integers. For consistency and because it looks weird, we disallow it for integer types too (e.g. `u0123`). Fixes #11963 Fixes #12417