Commit Graph

1180 Commits

Author SHA1 Message Date
gingerBill
ea5175d865 Support s: [2]u16 = "hi" 2026-05-02 12:11:39 +01:00
Franz Hoeltermann
0199c96f47 Fix type info not being generated for types only used in []typeid literals 2026-04-28 17:04:52 +02:00
gingerBill
31184535a0 Merge pull request #6605 from odin-lang/bill/array-cast
Native Array Casting Semantics
2026-04-28 11:07:31 +01:00
gingerBill
a40f275b0c Check to see if a normal type is being used in a typeid context 2026-04-27 09:23:04 +01:00
gingerBill
a44b8b0af0 Support ([N]T)([N]U{...}) 2026-04-23 10:42:53 +01:00
gingerBill
01734dfa9b Merge pull request #6599 from 3rd-Party-Guy/issue/6594-self-ref-global-init
Fixes #6594
2026-04-22 13:44:08 +01:00
Nikolay Hadzhiev
48e83ad003 gh 6594
prevent compiler crash from self-referential global initialisation
2026-04-22 13:14:08 +02:00
gingerBill
608709693b Fix #6590 2026-04-22 11:32:58 +01:00
gingerBill
ef275c5c0e Support []int{multiple_returns(), 123} 2026-04-21 17:45:36 +01:00
gingerBill
b1e8ec5e64 Allow for Some_Struct{multiple_return_value(), 123} 2026-04-21 17:17:59 +01:00
gingerBill
92c17b85e1 Allow assigning subtypes to unions 2026-04-21 16:35:57 +01:00
Weixie Cui
4e87f47fe3 Fix >= comparison runtime dependencies for string and cstring types
Token_GtEq incorrectly added *_gt runtime symbols for cstring, cstring16,
string16, and string comparisons; use the correct *_ge dependencies instead.
2026-03-26 18:21:27 +08:00
gingerBill
0fce2da442 Add suggestion when trying to slice an enumerated array 2026-03-25 15:03:37 +00:00
gingerBill
e10257f86a Fix slicing logic of a FCD array to check if it can be sliced or not 2026-03-25 14:11:22 +00:00
gingerBill
59eaa13625 Fix indexing logic of FCD arrays 2026-03-25 14:10:08 +00:00
gingerBill
a9e81e01aa Allow addressing of an index expression of an soa slice/dynamic array 2026-03-25 14:08:39 +00:00
gingerBill
85eeca2f03 Add missing generic #soa pointers to parapoly handling system 2026-03-25 10:15:58 +00:00
Harold Brenes
4f6caf19f0 Ensure checking for proc property equality before checking param assignability 2026-03-23 21:15:12 -04:00
Harold Brenes
147542b5cc Allow pointers to types which have subtype fields at offset 0
to be assignable in proc parameters.

```odin
// Virtual interface
IFoo :: struct {
	foo: proc( self: ^IFoo ),
}

// Implements IFoo interface
Foo :: struct {
	using vt: IFoo,
	name: string,
}

// Implement interface via `Foo`
Foo_Impl :: IFoo {
	// `self` of type `^Foo` (not `^IFoo`) is now accepted as a valid parameter.
	foo = proc( self: ^Foo ) {
		...
	},
}
```
2026-03-23 20:55:44 -04:00
gingerBill
85c05b238e Handle bit fields separately 2026-03-17 13:50:49 +00:00
gingerBill
d28e19c957 Minor improve to check if the entity was already there 2026-03-17 13:47:02 +00:00
gingerBill
153a522228 Use normal i64 arithmetic instead of big-ints for hot path 2026-03-17 13:34:06 +00:00
gingerBill
46936e0e52 General improvements 2026-03-17 12:55:25 +00:00
gingerBill
e18b15e8f0 Move error-only things to the error scopes 2026-03-17 12:16:44 +00:00
gingerBill
b19e89578f Improve check_struct_fields performance; use CheckerTypePath free list 2026-03-17 11:42:03 +00:00
gingerBill
04cb889aed Begin interning ScopeMap strings 2026-03-17 11:04:32 +00:00
gingerBill
36d5a19115 Replace Scope.elements to use a custom hash map ScopeMap
This hash map is robin hood based with a inline slot amount for small scopes
2026-03-16 17:41:58 +00:00
gingerBill
1744f57d01 Use permanent_alloc_item directly rather than through the gb_alloc_item generic interface 2026-03-16 16:03:27 +00:00
gingerBill
0314c91a64 Add error message for foo := Foo{&foo} where the type of foo is not determined yet 2026-03-15 16:16:46 +00:00
gingerBill
c6772dfd06 Merge branch 'master' into bill/fixed-capacity-dynamic-array 2026-03-15 11:41:01 +00:00
gingerBill
117e3a7b5a Merge branch 'master' of https://github.com/odin-lang/Odin 2026-03-15 10:34:01 +00:00
gingerBill
ca73cd395f Fix #6412 2026-03-15 10:33:52 +00:00
Jeroen van Rijn
27667ce36b iff -> if and only if (⟺) 2026-03-13 11:54:15 +01:00
gingerBill
a6160770ff Support compound literals for fixed capacity dynamic arrays 2026-03-12 10:03:58 +00:00
gingerBill
f1dbe9c242 [dynamic; N]T proof of concept: fixed capacity dynamic array (akin to small_array.Small_Array(N, T)) 2026-03-11 16:46:33 +00:00
Franz Hoeltermann
b351b58ddc Fix #6270 2026-03-03 17:22:31 +01:00
Louis Novy
e3d6fe72f8 fix broken bit_set parapoly specialization #6240 2026-03-01 20:58:43 -08:00
gingerBill
c0468446f6 Ignore const nil "optimization" and fix c: Maybe(string); c == "" bug. 2026-02-24 18:52:42 +00:00
gingerBill
7c9ac5a777 Try to improve the error handling for procedure groups 2026-02-19 13:51:20 +00:00
Jeroen van Rijn
6386b395de Add -did-you-mean-limit:N
```
-did-you-mean-limit:<integer>
        Sets the maximum number of suggestions the compiler provides.
        Must be an integer >0.
        If not set, the default limit is 10.
```
e.g. with a limit of 5

```
W:/Scratch/main.odin(44:7) Error: Undeclared name 'B1' for type 'E'
	e = .B1
	     ^^
	Suggestion: Did you mean?
		A23
		A02
		A19
		A20
		A21
		... and 25 more ...
```
2026-02-13 15:15:03 +01:00
gingerBill
67541434f4 Remove else check for untyped to typed 2026-01-29 11:58:37 +00:00
gingerBill
07d814d9cf Add struct #simple to force a struct to use simple comparison if all of the fields "nearly simply comparable". 2026-01-29 10:49:26 +00:00
gingerBill
27bd72c18a Fix constant indexing within a call that doesn't exist 2026-01-26 19:15:40 +00:00
gingerBill
3586bda6ae Use context.assertion_failure_proc with type assertions when the context is available, otherwise use a trivial trap. 2026-01-26 18:23:29 +00:00
Jeroen van Rijn
cd684ed7a0 Merge pull request #6159 from Barinzaya/fix-const-bitset-contains
Fix `in`/`not_in` on constant `bit_set`s
2026-01-24 14:32:33 +01:00
Jeroen van Rijn
e0ff16f98c Fix #6126
`ExactValue_Compound` wasn't handled properly.
2026-01-24 10:53:38 +01:00
Barinzaya
5e4895e76d Fixed some issues with in and not_in on constant bit_sets.
This addresses two issues:
- With a `bit_set` having no underlying type and a non-zero lower bound,
  `in` and `not_in` were returning incorrect results when done at
  compile-time.
- With a `bit_set` of more than 128 bits, `in` always returns false on
  values that fall within the upper 64 bits.
2026-01-23 16:19:46 -05:00
gingerBill
b0064f38cf Minor rearrange of check_is_operand_compound_lit_constant for future optimization prep 2026-01-22 13:17:54 +00:00
gingerBill
16254ed8fa Merge pull request #6119 from slowhei/master
Fix assertion error when imported proc groups are passed as proc arguments
2026-01-16 09:16:25 +00:00
gingerBill
5f07055ac1 Add #must_tail and "preserve/none" calling convention 2026-01-15 17:28:28 +00:00