Commit Graph
1353 Commits
Author SHA1 Message Date
gingerBill 3b6a32398b Merge pull request #7692 from corleypc/must-tail-disallow-odincc
Disallows the Odin calling convention with #must_tail
2026-10-02 11:38:27 +01:00
gingerBill 38fa57e907 Make global checking and codegen order-independent 2026-10-01 15:01:14 +01:00
gingerBill c6b9f8d998 Try to fix the #+lazy entities 2026-10-01 13:51:40 +01:00
gingerBill b06c5ffa70 Add -internal-global-entity-graph; Fix union type inference bug 2026-10-01 13:42:32 +01:00
Mihail Moskov 016414cc88 disallows odin cc with #must_tail 2026-10-01 15:09:24 +03:00
gingerBill 9602f57513 Minor refactor for visited sections 2026-10-01 11:03:10 +01:00
gingerBill 3551707607 parapoly: allow a constant default value for a polymorphic parameter 2026-10-01 10:53:29 +01:00
gingerBill 4e49db59a8 parapoly: default untyped args against a still-polymoprhic parameter 2026-10-01 09:54:10 +01:00
gingerBill 98203dbd56 parapoly: remove the in-place polymorphic match; substitution engine is now the only resolver 2026-10-01 09:27:34 +01:00
gingerBill 7c8dfd4cff Improve mixed order ternary type inference and poly-determination diagnostics 2026-10-01 01:30:38 +01:00
gingerBill 66111934c3 Allow parapoly procs to be in @(deferred_*) attributes 2026-10-01 01:17:40 +01:00
gingerBill d89709fea0 Allow untyped {...} against a union to be inferred correctly 2026-10-01 00:57:45 +01:00
gingerBill 614b45e919 Add optional annotations for the next error source line. 2026-10-01 00:49:36 +01:00
gingerBill f65f3cd4da parapoly: Fix bug on error reporting when none of the parameters match in a parapoly procedure 2026-10-01 00:22:06 +01:00
gingerBill 96dd7d22ec Improve the the ambiguous calls stuff further by trying to find a confident diagnosis 2026-10-01 00:17:12 +01:00
gingerBill 668559beeb Improve parapoly error messages for near misses and de-emphasize overloads whose first parameter cannot accept the first argument's container 2026-10-01 00:10:56 +01:00
gingerBill 5621e4e829 Allow append(&a, {1, 2}) 2026-09-30 23:42:22 +01:00
gingerBill e961edcea2 Handle ternary expressions when doing implicit parapoly determination 2026-09-30 23:13:48 +01:00
gingerBill a79cce3945 parapoly: Fix more cases of untyped expressions 2026-09-30 23:05:58 +01:00
gingerBill bbb2cf19a2 Begin work on deferring untyped compound literals in polymorphic call contexts 2026-09-30 23:00:17 +01:00
gingerBill 255b3da8b5 parapoly: match $T/Constraint through the subst engine 2026-09-30 21:58:47 +01:00
gingerBill 93a3312a29 Remove parapoly scaffolding and fix map internal generation 2026-09-30 20:49:28 +01:00
gingerBill 47ffc56d1a Handle anonymous parapoly unions better 2026-09-30 19:44:23 +01:00
gingerBill fa8588189d Continue to flesh out the new poly-subst engine 2026-09-30 19:01:38 +01:00
gingerBill 796fd261a4 Begin work on the improving the parapoly substitution engine 2026-09-30 17:36:14 +01:00
gingerBill 3b9ef40fae Clean up comments and add more wait signal guards for union variants 2026-09-30 15:53:31 +01:00
gingerBill 3b366c9e29 Begin work on handling the wait signals correctly for union variants throughout 2026-09-30 15:32:49 +01:00
gingerBill 98fd36b0e7 Fix [$E]$T bug where you need to capture polymorphic element node before rewriting the poly in place 2026-09-30 14:49:11 +01:00
gingerBill 781d9cbd8b parapoly: fix proc-cache race, record ABBA deadlock, and over-eager poly matching
Three fixes to the parametric-polymorphism checker.

src/check_expr.cpp
- find_or_generate_polymorphic_procedure: close a check-then-act race in the
  generated-procedure cache. Both lookups ran under a shared lock that was
  released before the insert, so two threads instantiating the same
  specialization could both miss and each publish a distinct entity. Re-check
  under the exclusive lock, now held across construction and the array_add so
  find-then-publish is atomic. Factor the reuse path into
  reuse_gen_polymorphic_procedure.
- is_polymorphic_type_assignable: require BOTH components to match for maps and
  enumerated arrays (|| -> &&). The old || accepted e.g. map[int]$V against
  map[string]f32 (binding $V and deferring the key mismatch to a confusing
  assignment error); it now fails cleanly at inference. Both sides are still
  evaluated, so modify_type side effects are unchanged.

src/check_type.cpp, src/check_expr.cpp
- check_struct_type: release the originating record's gen_types mutex right after
  the instantiation is published, before checking its fields. Holding it across
  field-checking (which instantiates other records) allowed a cross-record ABBA
  deadlock between mutually-recursive generic structs instantiated concurrently;
  concurrent finders now synchronize via the existing fields_wait_signal.
  Canonicalize the instantiation name before publishing
  (set_polymorphic_record_instantiation_name) so the early release cannot expose
  a torn Named.name. Unions are left unchanged: they lack a variants-ready
  signal, so early release is not yet safe for them.
2026-09-30 14:39:47 +01:00
gingerBill bc8635dbe7 Merge pull request #7674 from louisnovy/fix-deferred-procedure-conditional-calls
Fix #5105 and #5569: Deferred call in short circuits causes LLVM codegen failure
2026-09-30 11:11:52 +01:00
Louis Novy db46204e38 Catch calls of a deferred out proc in short circuits during check 2026-09-29 19:22:01 -04:00
gingerBill 383a2fe1e5 Reject complex/quaternion component overflow to match normal floats 2026-09-29 16:34:06 +01:00
gingerBill 95df4904e8 Change struct Complex128 and struct Quaternion256 to use ExactValue elements to allow for the new Big_Rat benefits that floats get 2026-09-29 16:00:28 +01:00
gingerBill 29b681b43d Handle more cases where ExactValue_Float was being handled but not for ExactValue_Rational 2026-09-29 15:21:00 +01:00
gingerBill 19f7b5e2e2 Add f16/f32 precision checks; Fix macOS MSIZE macro collision 2026-09-29 14:53:28 +01:00
gingerBill 7b19697dcf Integrate ExactValue_Rational throughout the codebase 2026-09-29 14:38:08 +01:00
gingerBill 798be5cc0a Merge pull request #7588 from Creativty/fix/CompoundLit_OOB
Error on OOB tuple element in compound literals
2026-09-29 13:14:46 +01:00
gingerBill 8640b38899 Merge pull request #7661 from louisnovy/fix-swizzle-through-pointer
Fix #7587: full length swizzles through a pointer keeping the pointer type
2026-09-29 13:06:24 +01:00
gingerBill d5a2ff0619 Merge pull request #7658 from corleypc/must-tail-wasm-fix
Fixes #must_tail on wasm targets
2026-09-29 13:03:59 +01:00
gingerBill b153d6071c Support bit_set[E; [4]u64] style types 2026-09-29 12:17:02 +01:00
gingerBill ae63a4a4c6 Fix big integer representation of large numbers such as 98765.0e309 2026-09-29 11:41:50 +01:00
Louis Novy adc2059d36 Merge branch 'master' of https://github.com/odin-lang/Odin into fix-swizzle-through-pointer
# Conflicts:
#	tests/issues/run.bat
#	tests/issues/run.sh
2026-09-29 02:27:05 -04:00
corley a931018a24 fixes #must_tail on wasm targets 2026-09-29 01:57:49 +03:00
gingerBill 9924dcebd3 Merge pull request #7629 from Dreamshade-1911/fix/proc-lit-union-variant-compound-lit
Fix #7596 and #7511
2026-09-27 15:01:39 +01:00
Louis Novy d65d743ab7 Fix full length swizzles through a pointer keeping the pointer type 2026-09-26 22:22:42 -04:00
Fernando Nunes a5e80c7530 fix(checker): record instantiated poly proc on selector when used as a proc value 2026-09-25 07:45:33 -03:00
Fernando Nunes bc68304497 fix #7596 and #7511: proc literal as union variant in compound literal crashes backend 2026-09-25 07:08:01 -03:00
alyekypo 23cc994255 fix(checker): keep entity iteration valid across a scope map rehash
`check_scope_decls` iterates a scope's entity map while
`check_entity_decl` can insert into that same scope: a procedure alias
(`f :: e`) goes through `override_entity_in_scope`, which calls
`scope_map_insert`. The map grows at 75% load (12 of 16 slots, then 24
of 32), and `scope_map_insert` grows before it probes for the key, so
even an alias that only replaces an existing value rehashes and
reallocates the table in the middle of the iteration.

`ScopeMapIterator` re-read its map on every step while `end` had
captured the capacity at loop start, so the walk continued over the new
table under the old sentinel: it ran past the end of the reallocated
table and dereferenced whatever followed it as an `Entity *` - a nullptr
dereference for a procedure scope holding exactly 12 or 24 entities - or
it stopped at the stale end index and silently skipped every declaration
that the rehash had moved behind it, which left unused declarations
without any diagnostic at all.

The iterator now snapshots the table pointer and capacity when it is
constructed, so iteration is invariant under any insert or grow and
cannot leave the table it began on. A scope that does not grow behaves
exactly as before: the snapshot points at the same table.

Refs #7598
2026-09-21 13:13:39 +00:00
Abderrahim Indjaren d32bbfd7be fix: oversight during underflow condition
fix: incorrect message format argument for index overflow
2026-09-18 03:04:18 +01:00
Abderrahim Indjaren 09c81c8a7f fix: prevent struct crashing from tuple expansion overflow 2026-09-18 02:50:18 +01:00