Commit Graph

1067 Commits

Author SHA1 Message Date
gingerBill
ee01643229 Add -integer-division-by-zero:self 2025-08-08 10:41:05 +01:00
gingerBill
991883d0e1 Add #+feature integer-division-by-zero:<string> 2025-08-08 10:24:44 +01:00
gingerBill
e4a0228a80 Define the behaviour of integer division by zero 2025-08-08 10:00:11 +01:00
gingerBill
eae43f1225 Merge branch 'master' into bill/utf16-strings 2025-08-05 15:07:06 +01:00
gingerBill
c910b5e583 Add intrinsics.type_is_nearly_simple_compare 2025-08-04 12:13:30 +01:00
gingerBill
bb4bc316a4 for in string16; Support string16 across core 2025-08-02 12:20:35 +01:00
gingerBill
ae02d3d02d Begin supporting string16 across the core library 2025-08-02 11:55:16 +01:00
gingerBill
2561427dd3 Add string16 and cstring16 (UTF-16 based strings) 2025-08-02 11:00:15 +01:00
gingerBill
7057fc8dfc Remove the semantics of #no_copy, keep the grammar 2025-07-30 23:14:29 +01:00
Paul-Andre Henegar
93a39affd1 Fix issue 5474
The fix was adding `is_constant = false;`

I also removed the unnecessary check regarding the first element of the
BitSet, since it's checked inside the loop, and also fixed a typo in the
message.
2025-07-28 01:42:19 -04:00
gingerBill
513e6daace Merge pull request #5081 from Lperlind/vet-explicit-allocators
Add -vet-explicit-allocators
2025-07-22 11:06:12 +01:00
Hayden Gray
f72b2b1530 [source-code-locations] - added options to show, obfuscate, and hide source code locations (#5412) 2025-06-26 22:43:44 +02:00
Laytan Laats
2c308bdcfa fix load type panic because front-end allows a deref of a type
Fixes #5357
2025-06-26 17:07:06 +02:00
Airtz
2259db9a53 Better error messages 2025-06-24 02:54:14 +02:00
Airtz
d65b1d5e94 Better proc groups inference 2025-06-23 18:10:40 +02:00
Airtz
38187ef206 Merge branch 'odin-lang:master' into fix-4445 2025-06-22 17:05:32 +02:00
Jeroen van Rijn
56d9671f63 Merge pull request #5368 from Airtz/master
Fix #5331 and `check_shift` improvements
2025-06-22 16:58:21 +02:00
Airtz
277130111e sign check error message update 2025-06-22 16:51:44 +02:00
Airtz
19c0f43e19 Fix #4445 2025-06-22 16:15:22 +02:00
Jeroen van Rijn
7abd86c211 Clarify --- for global variable. 2025-06-21 00:05:15 +02:00
Airtz
7c5b5618e8 check_is_expressible instead of convert_to_typed when there is no type_hint 2025-06-20 04:49:39 +02:00
Airtz
c7c5258c58 Update check_expr.cpp 2025-06-20 01:23:40 +02:00
Feoramund
5ed2735658 Guard against invalid proc types in parameter list
Fixes #4362
2025-06-10 06:13:14 -04:00
gingerBill
6804f4c471 Add support for #soa[N]T compound literals 2025-06-04 13:56:46 +01:00
Jeroen van Rijn
dd27049e13 Merge pull request #5261 from spiel0meister/master
add a missing nullptr check
2025-06-03 15:39:09 +02:00
Jeroen van Rijn
fcf0d4efa1 Merge pull request #5264 from LeandroLibanio28H/5243-fix-scope-attribute-proc-grouping
Fix scope attribute proc grouping (#5243 )
2025-06-03 14:49:40 +02:00
spiel0meister
d1fcec63cc early return; fix indentation 2025-06-03 14:46:44 +02:00
Leandro Libanio
0f5e30783c Update check_expr.cpp
Removing iostream
2025-06-03 08:55:38 -03:00
Jeroen van Rijn
82dfb43663 Fix #5265 2025-06-03 11:18:11 +02:00
LeandroLibanio28H
e6b086e78d Removing unreacheable block (since e86fde3) 2025-06-02 20:48:25 -03:00
LeandroLibanio28H
7b612a3a15 Checking if entity is exported before checking if it's a procedure group 2025-06-02 20:14:19 -03:00
spiel0meister
648fa9e54a check if expr is null 2025-06-02 23:24:46 +02:00
Feoramund
57019f199c Add suggestions for quaternionN or complexN conversions
Quaternions and complex numbers are constructed with `quaternion` and
`complex`, but their types are of the `*N` form.

These suggestions should point the user in the right direction.
2025-05-31 07:09:29 -04:00
gingerBill
594f1b30b4 Add Suggestion: 'context = runtime.default_context()' 2025-05-24 14:18:16 +01:00
Jeroen van Rijn
95183e4b9c Remove now unnecessary checks. 2025-05-21 19:37:09 +02:00
Jeroen van Rijn
96fd07e0ee Fix #5177 - Tweak error messages. 2025-05-21 19:20:58 +02:00
Jeroen van Rijn
ab95932502 -dynamic-literals 2025-05-19 20:44:27 +02:00
bogwi
af6b763449 CHECK 3 done
Enhance support for polymorphic procedures in type checking

1. In src/check_type.cpp, added special handling for polymorphic procedures used as default parameter values. We now allow a polymorphic procedure to be used as a default parameter value, even when its type parameters can't be immediately determined.

2. In src/check_expr.cpp, we modified the check_is_assignable_to_with_score function to handle the special case of assigning a polymorphic procedure as a default parameter. The function now allows a polymorphic procedure to be assigned to a concrete procedure type in this specific context.
2025-05-05 17:53:32 +09:00
Jeroen van Rijn
c96d8237ba Clarify error messages for types that aren't simply comparable.
Previously, it implied that these are different types:
```
W:/Scratch/scratch.odin(17:5) Error: Cannot compare expression, operator '==' not defined between the types 'Handle_Map($T=u32, $HT=u32, $Max=10000)' and 'Handle_Map($T=u32, $HT=u32, $Max=10000)'
    if m == {} {
       ^~~~~~^
```
Now:
```
W:/Scratch/scratch.odin(20:5) Error: Cannot compare expression. Type 'Handle_Map($T=u32, $HT=u32, $Max=10000)' is not simply comparable, so operator '==' is not defined for it.
	if m == {} {
	   ^~~~~~^
```
2025-05-03 22:31:01 +02:00
Jeroen van Rijn
9681d88cd3 Fix #5107
Fixes #5107 by checking whether `result_count` is non-zero before indexing `type->Proc.results->Tuple.variables`.
2025-05-03 14:42:20 +02:00
Laytan Laats
9fb9382449 fixes assigning null as a type if it's an alias but the base type isn't resolved yet
It's a bit of a band aid fix because the field will get the type of the
alias, not the base type, but that was already the case before #5045 so
it's forward progression.

Closes #5092
Fixes #5061
2025-04-30 19:39:38 +02:00
gingerBill
0de802d388 All N-valued (N>=2) expressions in or_else expressions 2025-04-29 17:39:28 +01:00
Lucas Perlind
65b4c793f0 Add -vet-explicit-allocators
This vet flag will make it so that allocators must be explicitly used
in places where context.allocator and context.temp_allocator are a
procedure parameter.

The goal of this flag is to prevent using the context.allocator in
cases where a different allocator was meant to be used.
Some code bases default context.allocator to nil/panic allocator
to catch this at runtime. This effectively makes it a compile
time error instead.
2025-04-27 22:47:03 +10:00
gingerBill
d3f0b31fcc Improve or_else type inference logic 2025-03-27 15:08:53 +00:00
gingerBill
7f61e53286 Fix #3955 2025-03-07 10:48:49 +00:00
gingerBill
97eeb25adc Fix #4244 2025-03-07 10:44:34 +00:00
gingerBill
97d410c2ae Fix #4909 2025-03-06 11:17:55 +00:00
Barinzaya
6e3d17d189 Fixed ~ on bit_set[Some_Enum] altering the definition of the enum.
This was occurring for enums whose minimum values were greater than
zero.
2025-03-02 13:29:39 -05:00
gingerBill
748a771dad Allow indirection for swizzling on procedure parameters 2025-02-21 12:38:40 +00:00
gingerBill
99d91ccd31 Work on making name mangling deterministic 2025-02-17 11:32:49 +00:00