Commit Graph

817 Commits

Author SHA1 Message Date
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
Veikka Tuominen
40ed6ae846
Merge pull request #13930 from r00ster91/renamings
std.builtin: renamings
2022-12-18 19:33:15 +02:00
shwqf
11a81e1b29 Call ensureResultUsed before comptime .call is evaluated.
Fixes #12580
2022-12-18 16:04:33 +02:00
r00ster91
ceff03f3e9 std.builtin: remove layout field from Type.Enum 2022-12-18 13:31:38 +01:00
r00ster91
aac2d6b56f std.builtin: rename Type.UnionField and Type.StructField's field_type to type 2022-12-17 14:11:33 +01:00
r00ster91
7350ea3e2d std.builtin: rename Type.Fn's args to params
This was a poor naming choice; these are parameters, not arguments.
Parameters specify what kind of arguments are expected, whereas the arguments are the actual values passed.
2022-12-17 14:11:33 +01:00
r00ster91
20d3fd901e std.builtin: rename Type.Fn.Param's arg_type to type
It's the type of a parameter, not an argument, but the prefix is redundant either way.
2022-12-17 14:11:33 +01:00
Veikka Tuominen
9bb1104e37 implement defining C variadic functions 2022-12-17 13:22:09 +02:00
Veikka Tuominen
58caed1c71 Sema: make is_non_{null,err} stricter about types
Closes #13023
2022-12-17 13:22:09 +02:00
Veikka Tuominen
8a0a6b7387 port packed vector elem ptr logic from stage1
Closes #12812
Closes #13925
2022-12-15 21:06:35 -05:00
Veikka Tuominen
bc97a5662d Sema: display cimport errors from clang 2022-12-14 14:08:22 +02:00
Veikka Tuominen
886fa455fa Sema: avoid analyzing functions which failed when inlining 2022-12-14 14:08:21 +02:00
Veikka Tuominen
41913ddb1a remove no longer relevant stage1 compile errors 2022-12-14 14:08:21 +02:00
Veikka Tuominen
927d20b46b Sema: implement missing stage1 errors 2022-12-14 14:08:21 +02:00
Veikka Tuominen
423d7a74a4 move async compile errors into their own folder 2022-12-14 14:05:57 +02:00
Veikka Tuominen
327fb798c3 move stage2 compile errors out of special folder 2022-12-14 14:05:57 +02:00
Veikka Tuominen
08b2d491bc update usages of @call 2022-12-13 13:14:20 +02:00
IntegratedQuantum
15a6336bb4
Add a helpful note when using ** on number types. (#13871) 2022-12-11 14:41:42 -05:00
r00ster91
654e30069d behavior and cases: more test coverage for old issues
Closes #2622
Closes #2727
Closes #6047
Closes #6947
Closes #6656
2022-12-10 12:34:42 +01:00
Veikka Tuominen
5831b68341 AstGen: add check for missing builtin argument
Closes #13817
2022-12-09 20:37:18 -07:00
Veikka Tuominen
653c0bae0c remove stage1 specific compile error tests 2022-12-07 20:32:27 +02:00
r00ster91
f094c4bce5 Sema: detect duplicate enum tag values 2022-12-04 14:12:24 +02:00
Veikka Tuominen
b500e0eb17 Sema: add "parameter type declared here" note to type coercion 2022-12-03 00:48:04 +02:00
Veikka Tuominen
74285a4ed7 add test for error message improved by self-hosted
Closes #5099
2022-12-03 00:48:04 +02:00
Veikka Tuominen
f20e449fd6 Sema: improve error for mismatched type in implicit return
Closes #2653
2022-12-03 00:48:03 +02:00
Veikka Tuominen
e2509ddbe6 AstGen: add error for invalid string comparisons
These operations are allowed because the string literals are just
pointers but they produce unexpected results. These errors prevent
beginners from shooting themselves in the foot while still allowing
advanced users to circumvent them if they desire to do so.

Closes #8290
2022-12-03 00:09:23 +02:00
Veikka Tuominen
59dad43de2 Sema: add error for failed assumption about struct having runtime bits 2022-12-02 18:46:59 +02:00
Veikka Tuominen
86e6acb37b AstGen: improve error message for missing parameter name
Closes #13393
2022-12-02 15:39:40 +02:00
Andrew Kelley
ceb0a632cf std.mem.Allocator: allow shrink to fail
closes #13535
2022-11-29 23:30:38 -07:00
Veikka Tuominen
b2b1d421c3 Sema: add missing failWithBadMemberAccess to zirExport
The assumption that AstGen would error only holds when exporting
a identifier not a namespace member.
2022-11-29 21:44:08 +02:00
Veikka Tuominen
4b0ef6a409 Sema: make non-existent field error point to field name
Closes #13698
2022-11-29 21:44:08 +02:00
Veikka Tuominen
ed73429926 Sema: explain why parameter must be declared comptime
Closes #13692
2022-11-29 21:44:08 +02:00
Veikka Tuominen
17ff002bc0 Sema: improve safety panic for access of inactive union field 2022-11-29 21:44:08 +02:00
Veikka Tuominen
6337c04244 Sema: improve panic for slice start index being greater than end index
Closes #13689
2022-11-29 15:47:02 +02:00
Veikka Tuominen
304e828088
Merge pull request #13637 from Vexu/stage2-fixes
Stage2 bug fixes
2022-11-26 22:03:49 +02:00
Veikka Tuominen
fe38898246 Sema: pass c_import_buf to child block in more places
Closes  #13651
2022-11-26 18:05:27 +02:00
Veikka Tuominen
587ef60a28 Sema: resolve union fields before using getTagType
Closes #13649
2022-11-26 18:05:27 +02:00
Veikka Tuominen
bf62cb453b Sema: handle anytype parameter requiring comptime
Closes #13645
2022-11-26 18:05:27 +02:00
Veikka Tuominen
9f055e2eb0 Sema: improve compile error for tuple coercion mismatch 2022-11-23 22:16:31 +02:00
Veikka Tuominen
8eea73fb92 add tests for tuple declarations 2022-11-23 22:16:31 +02:00
Veikka Tuominen
9e276d32f3 Sema: fix memory management of missing field error
Closes #13590
2022-11-20 20:25:12 +02:00
Veikka Tuominen
835a1f7f0c Sema: fix missing error on mismatched array init count
Closes #13582
2022-11-20 20:25:12 +02:00
Veikka Tuominen
034507ef7c Module: fix compile error for non-comptime-known global initializer 2022-11-20 20:25:12 +02:00
Veikka Tuominen
bc76873827 Sema: fix type check in zirIntToPtr
Simple fix: don't assume a ptr type before it has been checked.

Closes #13567
2022-11-20 20:25:11 +02:00
mparadinha
c4f7663c92
Fix error reporting the wrong line for struct field inits (#13502)
* point to init part of field delc when that's where the error occurs

* update test to reflect fixed error message

* only lookup source location in case of error
2022-11-15 15:17:23 +02:00
Veikka Tuominen
0a188190b3 AstGen: make pointless discard error more strict
The error should only happen as a result of `_ = <expr>` not
for an operand of a break expression that is discarded.

Closes #13212
2022-11-11 17:59:53 +02:00