Commit graph

498 commits

Author SHA1 Message Date
Veikka Tuominen
195c3cd89f fix errors in tests not tested locally or on CI 2022-07-21 12:21:30 -07:00
Veikka Tuominen
d729173204 stage2: better pointer source location 2022-07-21 12:21:30 -07:00
Veikka Tuominen
29815fe9de Sema: disallow 'align' on functions on wasm 2022-07-21 12:21:30 -07:00
Veikka Tuominen
62120e3d0e Sema: fix non-exhaustive union switch checks 2022-07-21 12:21:30 -07:00
Andrew Kelley
7d2e142679
Merge pull request #12044 from Vexu/stage2-compile-errors
Sema: add detailed error notes to `coerceInMemoryAllowed`
2022-07-11 20:45:27 -04:00
Veikka Tuominen
d00da05ecb Sema: validate extern types 2022-07-11 18:47:29 +03:00
Veikka Tuominen
3ceb27c840 Sema: better explanation why opaque types require comptime 2022-07-11 18:47:29 +03:00
Veikka Tuominen
20d4f7213d Sema: add notes about function return type 2022-07-11 17:55:19 +03:00
Veikka Tuominen
c9e1360cdb Sema: add "cannot convert to payload type" error notes 2022-07-11 14:17:22 +03:00
Veikka Tuominen
0370006c1f Sema: only add note about int mismatch if not coercible
`unsigned 64-bit int cannot represent all possible unsigned 63-bit values`
is nonsensical.
2022-07-11 11:59:26 +03:00
Veikka Tuominen
34fe2b4f4b Sema: prefer original error message in coerce 2022-07-10 23:47:56 +03:00
Veikka Tuominen
b9f01bc394 Sema: add detailed error notes to coerceInMemoryAllowed 2022-07-10 23:15:17 +03:00
Cody Tapscott
51a8f52e6c stage2: Support @offsetOf for tuples and anon structs 2022-07-08 19:51:35 -07:00
Veikka Tuominen
b5ac2b4330 Sema: improve array source location 2022-07-07 10:50:06 +03:00
Veikka Tuominen
27ee414159 Sema: improve slice source locations 2022-07-07 10:50:06 +03:00
Veikka Tuominen
89cef9f5f7 stage2: make line field of @src runtime known 2022-07-07 10:50:06 +03:00
Veikka Tuominen
226994cd7e Sema: misc error message fixes 2022-07-07 10:50:06 +03:00
Veikka Tuominen
c07c2d68c7 Sema: more runtime indexing comptime value checks 2022-07-07 10:50:06 +03:00
Veikka Tuominen
1569b9c165 Sema: validate pointer types 2022-07-07 10:50:05 +03:00
Veikka Tuominen
299836dbd9 Sema: panic at comptime + misc error message improvements 2022-07-07 10:50:05 +03:00
Andrew Kelley
f639cb33a9 fix expected error messages in test cases 2022-07-05 16:22:53 -07:00
Veikka Tuominen
2029601cb2 AstGen: use elem_{ptr,val}_node for array access syntax 2022-07-01 10:22:26 +03:00
Veikka Tuominen
a6bf8c2593 Sema: add more validation to zirFieldParentPtr 2022-07-01 10:22:25 +03:00
Veikka Tuominen
e6ebf56dd6 Sema: validate @intToEnum int operand type 2022-07-01 10:22:25 +03:00
Veikka Tuominen
ae7b32eb62 Sema: validate deref operator type and value 2022-07-01 10:22:25 +03:00
Veikka Tuominen
3c73f71177 Sema: prefer func.onwer_decl for compilelog src 2022-07-01 10:22:25 +03:00
Veikka Tuominen
3014a0d5f1 Sema: validate callconv 2022-07-01 10:22:25 +03:00
Veikka Tuominen
6d24c40b6e Sema: improve bitcast to enum error 2022-07-01 09:29:13 +03:00
Veikka Tuominen
4cde6dd109 adjust tests that didn't pass CI 2022-06-30 21:47:26 +03:00
Veikka Tuominen
90ae37cc00 tests: move compile errors not planned for stage2 2022-06-30 09:57:38 +02:00
Veikka Tuominen
cc3336c784 Sema: add source location to coerce result ptr, fix negation error 2022-06-30 09:57:38 +02:00
Veikka Tuominen
979910dc38 Sema: validate shift amounts and switch ranges 2022-06-30 09:57:38 +02:00
Veikka Tuominen
6cadac18b8 Sema: improve auto generated union enum name 2022-06-30 09:57:38 +02:00
Veikka Tuominen
2e7dc5e151 Sema: improve vector overflow errors 2022-06-30 09:57:38 +02:00
Veikka Tuominen
03b356e34a Sema: improve @call errors 2022-06-30 09:57:38 +02:00
Veikka Tuominen
3204d00a5e move passing stage1 compile error tests to stage2 2022-06-30 09:57:38 +02:00
Andrew Kelley
8caa206417 test-cases: fix race with zig run on C backend tests
Also avoid redundantly doing compile-error checks on multiple targets
for test cases where that is not helpful.
2022-06-14 15:27:43 -07:00
Andrew Kelley
434226c89d stage2: fix type printing of sub-byte pointers 2022-06-08 15:18:43 -07:00
Veikka Tuominen
cb5d2b691a Sema: validate equality on store to comptime field 2022-06-06 13:11:50 -07:00
Veikka Tuominen
50a6b0f3ac Sema: fix function type callconv inference 2022-06-04 11:33:18 +03:00
Andrew Kelley
4994ac18e4
Merge pull request #11733 from Vexu/stage2
more misc stage2 fixes
2022-05-27 16:20:49 -04:00
Veikka Tuominen
e08cdad53b Sema: add error for runtime indexing comptime array 2022-05-27 10:29:15 +03:00
Jakub Konka
5ce9c878cf apply Vexu's suggestion to use failing_allocator for now 2022-05-26 16:55:31 +02:00
Jakub Konka
d1e4600675 test: correctly track identical error msgs in handled errors list
Prior to this change, for an example compiler error test case with
multiple identical errors messages such as

```
:1:2: error: foo
:1:2: error: foo
```

the test harness would never increment the error index thus only
marking the very first error message as handled yielding a false
positive.

Additionally, while here, regress `dereference_anyopaque` test case
as not passing on `wasm32-wasi` target.
2022-05-26 16:23:56 +02:00
Veikka Tuominen
92c4e4f2c2 Sema: zirArrayType does need source location 2022-05-26 13:26:55 +03:00
Veikka Tuominen
b0e8bf15f5 Sema: add error for dereferencing comptime value at runtime 2022-05-25 17:39:55 +03:00
Andrew Kelley
7db39384f7 move bound function behavior test to compile error test 2022-05-24 15:34:52 -07:00
Jakub Konka
3624e1ef48 test: move compile errors and incremental tests into common dir 2022-05-04 23:51:16 +02:00