Const enum methods are not being recognized. #2445

This commit is contained in:
Christoffer Lerno
2025-08-31 23:56:48 +02:00
parent d291a40f69
commit a751177a3e
3 changed files with 17 additions and 0 deletions

View File

@@ -92,6 +92,7 @@
- Compiler module-scope pointer to slice with offset, causes assert. #2446
- Compiler hangs on == overload if other is generic #2443
- Fix missing end of line when encountering errors in project creation.
- Const enum methods are not being recognized. #2445
### Stdlib changes
- Add `==` to `Pair`, `Triple` and TzDateTime. Add print to `Pair` and `Triple`.

View File

@@ -3221,6 +3221,7 @@ INLINE bool type_is_user_defined(Type *type)
{
static const bool user_defined_types[TYPE_LAST + 1] = {
[TYPE_ENUM] = true,
[TYPE_CONST_ENUM] = true,
[TYPE_STRUCT] = true,
[TYPE_FUNC_RAW] = true,
[TYPE_UNION] = true,

View File

@@ -0,0 +1,15 @@
module test;
enum Enum : const int
{
E0, E1
}
fn void Enum.foo(self) {}
fn int main()
{
Enum e = E0;
e.foo();
return 0;
}