Andrew Kelley
7177b39946
fix test-case copy-paste typo from earlier commit
...
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-15 12:32:17 -07:00
Andrew Kelley
21b544a90a
fix compile log test case expected output
2023-03-15 10:48:15 -07:00
Andrew Kelley
6664d2418d
test-cases: add missing compile log output
...
The new testing harness is not bound by previous limitations; it can now
test compile log output as well.
2023-03-15 10:48:15 -07:00
Andrew Kelley
29cfd47d65
re-enable test-cases and get them all passing
...
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-15 10:48:14 -07:00
mlugg
948926c513
Sema: improve error message when calling non-member function as method
...
Resolves : #14880
2023-03-12 18:47:02 +02:00
mlugg
023753b469
Sema: correctly detect use of undefined within slices in @Type
...
Resolves : #14712
2023-03-10 12:18:06 +02:00
mlugg
14590e956e
Fix test case added in 6d7fb8f
2023-03-09 23:25:38 +02:00
mlugg
6d7fb8f19c
Sema: check type of comptime try operand
...
Resolves : #14693
2023-03-09 02:02:19 +02:00
John Schmidt
ecc0108cea
astgen: fill result location with void value if no other value
...
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-08 16:35:53 +02:00
r00ster91
010596c930
AstGen: compile-error on primitive value export
...
Fixes #14778
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2023-03-04 22:52:57 +02:00
John Schmidt
e41bc640c6
astgen: do not discard result location in for/while loops
...
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-03-01 02:51:59 -05:00
Isaac Freund
05da5b32a8
Sema: implement @fieldParentPtr for unions
2023-02-21 15:57:13 +02:00
Andrew Kelley
53104b9165
add test coverage for fixed bug. closes #5410
2023-02-19 21:18:27 -07:00
Veikka Tuominen
f10950526e
implement writeToMemory/readFromMemory for pointers
2023-02-19 13:54:52 -05:00
Andrew Kelley
8b05205bb7
implement error for unbounded for loops
2023-02-18 19:20:19 -07:00
Andrew Kelley
4dd958d585
improve error message for byref capture of byval array
2023-02-18 19:20:19 -07:00
Andrew Kelley
601db3981c
fix source location for not-indexable for loop errors
2023-02-18 19:20:19 -07:00
Andrew Kelley
bcb72401d3
AstGen: add error for discard of unbounded counter
2023-02-18 19:17:21 -07:00
Andrew Kelley
22965e6fcb
Sema: improve error message for mismatched for loop lengths
2023-02-18 19:17:21 -07:00
Andrew Kelley
8c96d0dddd
update test-cases for new for loop syntax
2023-02-18 19:17:21 -07:00
Veikka Tuominen
7199d7c777
split @qualCast into @constCast and @volatileCast
2023-02-15 01:43:57 +02:00
Veikka Tuominen
b9c2837c1c
Sema: validate inferred error set payload type
...
This was missed in b0a55e1b3be3a274546f9c18016e9609d546bdb0
2023-02-11 14:36:54 +02:00
Andrew Kelley
6b7ad22981
Merge pull request #14477 from Vexu/fixes
...
Improve `@ptrCast` errors, fix some bugs
2023-02-01 23:31:52 -05:00
Veikka Tuominen
490addde27
Sema: fix error location on comptime arg to typed generic param
...
Closes #14505
2023-02-01 20:50:43 +02:00
Andrew Kelley
34b3145099
update test case for new std.builtin.OptimizeMode API
2023-01-31 15:09:35 -07:00
r00ster91
17404f8e6e
Sema: emit compile error for comptime or inline call of function pointer
2023-01-31 17:15:34 +02:00
Veikka Tuominen
f16c10a86b
implement @qualCast
2023-01-30 18:55:57 +02:00
Veikka Tuominen
fe4ea31f7e
Sema: replace backticks with single quotes
...
Most error messages already use single quotes for everything
so this makes the remaining ones consistent.
2023-01-30 15:20:16 +02:00
Veikka Tuominen
a9785fe8ee
Sema: add helpful notes to invalid @ptrCast operations
...
Closes #14474
2023-01-30 15:20:16 +02:00
Veikka Tuominen
b129350cb5
AstGen: fix crash on invalid decltest
...
Closes #14476
2023-01-30 15:20:16 +02:00
Veikka Tuominen
720d82721f
Sema: ensure args to inline comptime args are comptime-known
...
Closes #14413
2023-01-30 15:20:16 +02:00
Veikka Tuominen
1f475de852
Sema: fix unwrapping null when reporting error on member access
...
Closes #14399
2023-01-22 01:04:20 +02:00
Veikka Tuominen
94be9dcc7f
enable passing compile error test
2023-01-17 20:28:43 +02:00
Veikka Tuominen
1658e4893d
AstGen: add note pointing to tuple field
...
Closes #14188
2023-01-11 21:11:21 +02:00
Veikka Tuominen
8b1780d939
Sema: fix condition for omitting comptime arg from function type
...
Closes #14164
2023-01-11 21:11:21 +02:00
Veikka Tuominen
f2faa303a5
Sema: handle enum expressions referencing local variables
...
Closes #12272
2023-01-05 22:03:32 +02:00
Veikka Tuominen
8c4727f9ab
Sema: remove generic function from monomorphed_funcs on any error
2023-01-05 14:26:53 +02:00
Veikka Tuominen
3e084d8de3
Sema: only untyped undefined should coerce to all types
...
Closes #13958
2023-01-05 14:26:53 +02:00
Veikka Tuominen
352c71873b
Sema: improve struct/union field error locations
...
Closes #14206
2023-01-05 13:11:36 +02:00
Veikka Tuominen
abd005f302
Sema: do not immediately destroy failed generic instantiation
...
Closes #12535
Closes #12765
Closes #12927
2023-01-03 18:38:15 +02:00
Veikka Tuominen
332a43858a
Sema: @intToEnum on non-exhaustive enum at comptime should check int is in range
...
Closes #14155
2023-01-02 17:06:06 +02:00
Veikka Tuominen
58c1d98c14
add tests for fixed stage1 bugs
...
Closes #4144
Closes #4255
Closes #4372
Closes #4375
Closes #4380
Closes #4417
Closes #4423
Closes #4476
Closes #4528
Closes #4562
Closes #4572
Closes #4597
Closes #4639
Closes #4672
Closes #4782
Closes #4955
Closes #4984
Closes #4997
Closes #5010
Closes #5114
Closes #5166
Closes #5173
Closes #5276
2022-12-31 20:49:02 -05:00
Veikka Tuominen
e0b6140009
Type: fix printing of default alignment on non-byte aligned pointers
2022-12-29 12:47:11 +02:00
Veikka Tuominen
9a0c593a54
add tests for fixed stage1 bugs
...
Closes #1957
Closes #1994
Closes #2140
Closes #2746
Closes #2802
Closes #2855
Closes #2895
Closes #2981
Closes #3054
Closes #3158
Closes #3234
Closes #3259
Closes #3371
Closes #3376
Closes #3387
Closes #3529
Closes #3653
Closes #3750
Closes #3778
Closes #3882
Closes #3915
Closes #3929
Closes #3961
Closes #3988
Closes #4123
Closes #7448
2022-12-29 12:42:44 +02:00
Andrew Kelley
0be6157a23
disable failing compile errors test
...
tracking issue #14105
2022-12-28 12:08:03 -07:00
Veikka Tuominen
81443fcde8
Sema: add error for recursive inline call
...
Closes #12973
2022-12-26 16:36:30 +02:00
Andrew Kelley
f211c1559a
Merge pull request #13960 from r00ster91/stage1cruft
...
Close more old stage1 issues
2022-12-22 16:36:55 -05:00
r00ster91
a429f72ae8
cases: more test coverage
...
Closes #11986
Closes #11850
Closes #12159
2022-12-21 23:34:29 +01:00
Veikka Tuominen
0eddf0cbc0
Sema: fix condition for non-pointer noalias error
...
Closes #13987
2022-12-19 12:19:25 +02:00
Andrew Kelley
aca9c74e80
Merge pull request #13914 from Vexu/variadic
...
implement defining C variadic functions
2022-12-18 16:24:13 -05:00