aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors
AgeCommit message (Collapse)Author
2023-04-25update test cases for new memcpy/memset semanticsAndrew Kelley
2023-04-25Sema: implement comptime `@memset`Andrew Kelley
2023-04-23Improvements to docs and textzooster
* docs(std.math): elaborate on difference between absCast and absInt * docs(std.rand.Random.weightedIndex): elaborate on likelihood I think this makes it easier to understand. * langref: add small reminder * docs(std.fs.path.extension): brevity * docs(std.bit_set.StaticBitSet): mention the specific types * std.debug.TTY: explain what purpose this struct serves This should also make it clearer that this struct is not supposed to provide unrelated terminal manipulation functionality such as setting the cursor position or something because terminals are complicated and we should keep this struct simple and focused on debugging. * langref(package listing): brevity * langref: explain what exactly `threadlocal` causes to happen * std.array_list: link between swapRemove and orderedRemove Maybe this can serve as a TLDR and make it easier to decide. * PrefetchOptions.locality: clarify docs that this is a range This confused me previously and I thought I can only use either 0 or 3. * fix typos and more * std.builtin.CallingConvention: document some CCs * langref: explain possibly cryptic names I think it helps knowing what exactly these acronyms (@clz and @ctz) and abbreviations (@popCount) mean. * variadic function error: add missing preposition * std.fmt.format docs: nicely hyphenate * help menu: say what to optimize for I think this is slightly more specific than just calling it "optimizations". These are speed optimizations. I used the word "performance" here.
2023-04-21cbe: fix remaining aarch64 issuesJacob Young
2023-04-20Sema: allow ptr field access on pointer-to-arraymlugg
Also remove an incorrect piece of logic which allowed fetching the 'len' property on non-single-ptrs (e.g. many-ptrs) and add a corresponding compile error test case. Resolves: #4765
2023-04-12Zir: implement explicit block_comptime instructionmlugg
Resolves: #7056
2023-04-05Sema: validate array element typesVeikka Tuominen
Fixes the compiler crash part of #15175
2023-03-26Module: fix lazy srcloc resolution for new for loop syntaxVeikka Tuominen
Closes #15081
2023-03-21fix broken test cases exposed by ec445fb6b8bb3f3d423cafa4f3a7860da65ca233Veikka Tuominen
shoulda rebased
2023-03-21Improve error messages for break type coercionJohn Schmidt
2023-03-21Merge pull request #15028 from Vexu/compile-errorsVeikka Tuominen
Sema: improve error message of field access of wrapped type
2023-03-20Port some stage1 test cases to stage2mlugg
There are now very few stage1 cases remaining: * `cases/compile_errors/stage1/obj/*` currently don't work correctly on stage2. There are 6 of these, and most of them are probably fairly simple to fix. * `cases/compile_errors/async/*` and all remaining `safety/*` depend on async; see #6025. Resolves: #14849
2023-03-21Sema: improve error message of field access of wrapped typeVeikka Tuominen
Closes #15027
2023-03-16Add error for bad cast from `*T` to `*[n]T`InKryption
Casting `*T` to `*[1]T` should still work, but every other length will now be a compiler error instead of a potential OOB access.
2023-03-15fix test-case copy-paste typo from earlier commitAndrew Kelley
commit 3204d00a5e7fe119b690e921138a439fb84dff5b intended to move this passing test case from stage1 folder but it was accidentally changed to have identical contents as a different test case instead. Fortunately, the test case has not regressed, so I simply replaced it with the intended test from before.
2023-03-15fix compile log test case expected outputAndrew Kelley
2023-03-15test-cases: add missing compile log outputAndrew Kelley
The new testing harness is not bound by previous limitations; it can now test compile log output as well.
2023-03-15re-enable test-cases and get them all passingAndrew Kelley
Instead of using `zig test` to build a special version of the compiler that runs all the test-cases, the zig build system is now used as much as possible - all with the basic steps found in the standard library. For incremental compilation tests (the ones that look like foo.0.zig, foo.1.zig, foo.2.zig, etc.), a special version of the compiler is compiled into a utility executable called "check-case" which checks exactly one sequence of incremental updates in an independent subprocess. Previously, all incremental and non-incremental test cases were done in the same test runner process. The compile error checking code is now simpler, but also a bit rudimentary, and so it additionally makes sure that the actual compile errors do not include *extra* messages, and it makes sure that the actual compile errors output in the same order as expected. It is also based on the "ends-with" property of each line rather than the previous logic, which frankly I didn't want to touch with a ten-meter pole. The compile error test cases have been updated to pass in light of these differences. Previously, 'error' mode with 0 compile errors was used to shoehorn in a different kind of test-case - one that only checks if a piece of code compiles without errors. Now there is a 'compile' mode of test-cases, and 'error' must be only used when there are greater than 0 errors. link test cases are updated to omit the target object format argument when calling checkObject since that is no longer needed. The test/stage2 directory is removed; the 2 files within are moved to be directly in the test/ directory.
2023-03-12Sema: improve error message when calling non-member function as methodmlugg
Resolves: #14880
2023-03-10Sema: correctly detect use of undefined within slices in @Typemlugg
Resolves: #14712
2023-03-09Fix test case added in 6d7fb8fmlugg
2023-03-09Sema: check type of comptime try operandmlugg
Resolves: #14693
2023-03-08astgen: fill result location with `void` value if no other valueJohn Schmidt
With this change, `break` and `break :blk` will fill the result location with `.void_value`, ensuring that the value will be type checked. The same will happen for a for loop that contains no `break`s in it's body. Closes https://github.com/ziglang/zig/issues/14686.
2023-03-04AstGen: compile-error on primitive value exportr00ster91
Fixes #14778 Co-authored-by: Veikka Tuominen <git@vexu.eu>
2023-03-01astgen: do not discard result location in for/while loopsJohn Schmidt
If we use the discard result location any break with a value will be ignored and not checked for usage. Closes https://github.com/ziglang/zig/issues/14684.
2023-02-21Sema: implement @fieldParentPtr for unionsIsaac Freund
2023-02-19add test coverage for fixed bug. closes #5410Andrew Kelley
2023-02-19implement `writeToMemory`/`readFromMemory` for pointersVeikka Tuominen
2023-02-18implement error for unbounded for loopsAndrew Kelley
2023-02-18improve error message for byref capture of byval arrayAndrew Kelley
2023-02-18fix source location for not-indexable for loop errorsAndrew Kelley
2023-02-18AstGen: add error for discard of unbounded counterAndrew Kelley
2023-02-18Sema: improve error message for mismatched for loop lengthsAndrew Kelley
2023-02-18update test-cases for new for loop syntaxAndrew Kelley
2023-02-15split `@qualCast` into `@constCast` and `@volatileCast`Veikka Tuominen
2023-02-11Sema: validate inferred error set payload typeVeikka Tuominen
This was missed in b0a55e1b3be3a274546f9c18016e9609d546bdb0
2023-02-01Merge pull request #14477 from Vexu/fixesAndrew Kelley
Improve `@ptrCast` errors, fix some bugs
2023-02-01Sema: fix error location on comptime arg to typed generic paramVeikka Tuominen
Closes #14505
2023-01-31update test case for new std.builtin.OptimizeMode APIAndrew Kelley
2023-01-31Sema: emit compile error for comptime or inline call of function pointerr00ster91
2023-01-30implement `@qualCast`Veikka Tuominen
2023-01-30Sema: replace backticks with single quotesVeikka Tuominen
Most error messages already use single quotes for everything so this makes the remaining ones consistent.
2023-01-30Sema: add helpful notes to invalid `@ptrCast` operationsVeikka Tuominen
Closes #14474
2023-01-30AstGen: fix crash on invalid decltestVeikka Tuominen
Closes #14476
2023-01-30Sema: ensure args to inline comptime args are comptime-knownVeikka Tuominen
Closes #14413
2023-01-22Sema: fix unwrapping null when reporting error on member accessVeikka Tuominen
Closes #14399
2023-01-17enable passing compile error testVeikka Tuominen
2023-01-11AstGen: add note pointing to tuple fieldVeikka Tuominen
Closes #14188
2023-01-11Sema: fix condition for omitting comptime arg from function typeVeikka Tuominen
Closes #14164
2023-01-05Sema: handle enum expressions referencing local variablesVeikka Tuominen
Closes #12272