Commit Graph

360 Commits

Author SHA1 Message Date
Jeroen van Rijn
e735e036b4 Fix #5447
Thanks to @FourteenBrush
2025-07-09 23:55:57 +02:00
Airtz
fb3bccdd3e Fix an oversight for operators with more than 2 chars 2025-06-24 16:09:42 +02:00
Airtz
2259db9a53 Better error messages 2025-06-24 02:54:14 +02:00
Feoramund
d046214f67 Be strict with type switch case column alignment too
This copies the same block used for regular switch cases.

Fixes #4673
2025-06-04 14:00:33 -04:00
gingerBill
7853a1db1c Fix #5228 2025-05-29 16:35:28 +01:00
bogwi
3c0ba5bb55 CHECK 4 done
The original errors:
1. `5024.odin(127:15) Error: Invalid use of a polymorphic type 'List($T)' in variable declaration`
2. `5024.odin(129:17) Error: Cannot determine polymorphic type from parameter: 'invalid type' to 'List($T)'`
Are gone. We now have a single, different error:
`5024.odin(124:28) Error: Unspecialized polymorphic types are not allowed in procedure parameters, got List($T)`

This error points directly to the `list : List($T)` parameter within the `List_Filter` procedure definition. This seems much more relevant to the actual problem (the interaction between the generic `List_Filter` and the concrete `default_filter`) than the original error about the variable declaration.

While this new error message might not be exactly pinpointing the default parameter issue, it correctly identifies the problematic procedure definition (`List_Filter`) as the source of the error, rather than the variable declaration (`my_list`). This seems like a step in the right direction for improving the error reporting for this kind of scenario.
2025-05-05 22:39:03 +09:00
gingerBill
77b5eebf8c Add trivial sanity check for assigning to return values within defer #5011 2025-04-07 11:57:55 +01:00
gingerBill
0ab323012e Use TypeSet instead of PtrSet<Type *> 2025-02-20 11:12:59 +00:00
gingerBill
328d893cb5 #unroll(N) for 2025-01-10 12:22:18 +00:00
gingerBill
e3b1646490 Fix #4552 2024-12-05 15:46:35 +00:00
gingerBill
f5b16aa42a Fix #4561 2024-12-05 15:27:41 +00:00
gingerBill
2392300ffb Add warning for unsigned >= 0 like conditions in a for loop 2024-10-30 14:12:49 +00:00
gingerBill
abf6ea7732 Fix minor bug with addressability 2024-09-17 10:24:19 +01:00
gingerBill
aa659a637a Fix #4132 2024-08-24 15:46:54 +01:00
gingerBill
683dde1fa0 Disallow labelled branches in defer - fix #3960 2024-08-24 12:47:29 +01:00
gingerBill
0e82a46047 Fix #3999 2024-08-18 12:35:25 +01:00
gingerBill
c4e0cbcd87 Fix #4005 2024-08-18 12:21:35 +01:00
gingerBill
f82bf6cd42 Fix #4022 2024-08-18 12:13:52 +01:00
gingerBill
17740966e5 Fix #4040 2024-08-18 12:06:58 +01:00
Davi
4bb51249d1 Error if assigning to rodata variable with index 2024-08-13 23:28:34 -03:00
gingerBill
6eb28aeafc Check to see if people are return a slice of a local fixed array from a procedure 2024-07-22 22:52:10 +01:00
Jeroen van Rijn
431227d4c5 Add NULL check in check_range_stmt
Fixes #3953
2024-07-21 02:52:53 +02:00
Feoramund
b38237e8f0 Fix compiler crash when switching on no value 2024-07-14 14:59:00 -04:00
gingerBill
c54e3d3c4f Improve warning handling for possible default: typo 2024-07-10 13:45:21 +01:00
gingerBill
e8517e2694 -strict-style: enforce case to be in the same column as switch 2024-06-29 18:56:45 +01:00
gingerBill
fa3cae2bb0 Add intrinsics.procedure_of
```odin
foo :: proc(x: $T) { fmt.println(x) }
bar :: intrinsics.procedure_of(foo(int(123))) // parameters are never ran at compile time, similar to `size_of`
bar(333) // prints 333
```
2024-06-10 15:02:34 +01:00
gingerBill
be0774acc8 Add error message on return a constant slice value from a procedure 2024-06-08 16:07:28 +01:00
gingerBill
7e994b6d21 Remove empty line preventing a suggestion from happening 2024-06-08 15:42:19 +01:00
gingerBill
bea47db495 Allow @(rodata) on @(static) variables 2024-06-06 15:20:47 +01:00
gingerBill
9ef43fc782 Add @(rodata) 2024-06-06 15:16:34 +01:00
gingerBill
66acbb7fed Add @(link_suffix=<string>) 2024-05-30 21:48:23 +01:00
gingerBill
7dc1f114b9 Add shadow suggestion 2024-05-22 22:22:41 +01:00
gingerBill
46b3e7b6fa Fix for &v in &fixed_array 2024-05-20 13:36:32 +01:00
gingerBill
b2dc5cc812 Fix error reporting for enforce new switch/for syntax 2024-05-16 15:32:15 +01:00
gingerBill
a344bc4c0e Remove the old switch/for semantics entirely and enforce switch &x in y 2024-05-16 14:39:16 +01:00
gingerBill
7734b12f9a Fix #3587 2024-05-14 00:16:32 +01:00
gingerBill
20f8f9012d Attempt at fixing #3588 2024-05-14 00:11:57 +01:00
gingerBill
8b4a8e4d80 Fix #3569 2024-05-13 12:49:12 +01:00
gingerBill
34c8739b69 Fix #3578 2024-05-13 12:42:06 +01:00
gingerBill
4eab735b13 Minor clean up of is_terminating code
This does not fix all known issues with it
2024-05-13 12:24:50 +01:00
gingerBill
ad5c9469d8 Fix #3522 2024-05-10 14:22:43 +01:00
gingerBill
5e1b376e22 Disallow for x in bitset_or_map if x is a variable that matches the "key" 2024-04-27 10:34:17 +01:00
gingerBill
393e4a9db6 Generalize Odin call-based "iterators" to work with more than 2-values: for x, y, z, w in iterate(&it)
It has an artificial limitation of 100 values because if you need for than that, you're doing something wrong.
2024-04-27 09:53:02 +01:00
gingerBill
5726b7d954 Remove warning on clang 2024-04-12 14:51:22 +01:00
gingerBill
46b9bd8c0e Improve error messages for switch and for r-values with a suggestion 2024-04-12 13:35:14 +01:00
gingerBill
f36fb6d1ef Add nil checks 2024-04-11 15:41:01 +01:00
oskarnp
ca46484ae3 Fix checker crash when or_return/or_break/or_continue used for non-existing proc 2024-04-06 11:02:43 +02:00
gingerBill
2375ac22a7 Improve error messages for A variable declaration must be an identifier 2024-04-04 16:57:08 +01:00
gingerBill
84686c70c5 Error message when RTTI is disabled when iterating over an enum type or a bit_set of enum with for in 2024-04-01 13:16:49 +01:00
gingerBill
3fa02427b3 Unify error message logic for ranges over bit_set 2024-04-01 13:12:09 +01:00