mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Const enum methods are not being recognized. #2445
This commit is contained in:
@@ -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`.
|
||||
|
||||
@@ -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,
|
||||
|
||||
15
test/test_suite/enumerations/const_enum_methods.c3t
Normal file
15
test/test_suite/enumerations/const_enum_methods.c3t
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user