- Resolving a missing property on a const enum with inline, reached an assert #2597.

This commit is contained in:
Christoffer Lerno
2025-11-25 23:48:40 +01:00
parent 869a1d93cb
commit 4f3b6f922d
3 changed files with 15 additions and 1 deletions

View File

@@ -41,6 +41,7 @@
- Add sigsegv stacktrace in test and regular errors for Darwin Arm64. #1105
- Incorrect error message when using generic type that isn't imported #2589
- `String.to_integer` does not correctly return in some cases where it should #2590.
- Resolving a missing property on a const enum with inline, reached an assert #2597.
### Stdlib changes
- Add `CGFloat` `CGPoint` `CGSize` `CGRect` types to core_foundation (macOS).

View File

@@ -1038,7 +1038,8 @@ Decl *sema_resolve_type_method(SemaContext *context, CanonicalType *type, const
type = type_decl->distinct->type->canonical;
goto RETRY;
case TYPE_ENUM:
type = type_decl->enums.type_info->type->canonical;
case TYPE_CONST_ENUM:
type = enum_inner_type(type);
goto RETRY;
default:
UNREACHABLE

View File

@@ -0,0 +1,12 @@
module test;
enum MyEnum : const inline short
{
ITEM1,
ITEM2,
}
fn int main(String[] args)
{
$typefrom("MyEnum").oops; // #error: No method or inner struct/union 'MyEnum.oops'
return 0;
}