Fix problems using reflection on interface types #1203.

This commit is contained in:
Christoffer Lerno
2024-06-03 21:59:18 +02:00
parent ddfc9313e0
commit f7e7e16c25
3 changed files with 4 additions and 0 deletions

View File

@@ -302,6 +302,7 @@ enum TypeKind : char
VECTOR,
DISTINCT,
POINTER,
INTERFACE,
}
struct TypeEnum

View File

@@ -29,6 +29,7 @@
- Better checking of operator methods.
- Bug when assigning an optional from an optional.
- Lambdas were not type checked thoroughly #1185.
- Fix problems using reflection on interface types #1203.
### Stdlib changes
- "init_new/init_temp" removed.

View File

@@ -3112,6 +3112,7 @@ static inline bool sema_expr_analyse_type_access(SemaContext *context, Expr *exp
return sema_expr_rewrite_to_type_property(context, expr, canonical, type_property_by_name(name), parent_type);
}
}
if (!type_may_have_sub_elements(canonical))
{
if (missing_ref) goto MISSING_REF;
@@ -3153,6 +3154,7 @@ static inline bool sema_expr_analyse_type_access(SemaContext *context, Expr *exp
case DECL_STRUCT:
case DECL_DISTINCT:
case DECL_BITSTRUCT:
case DECL_INTERFACE:
break;
default:
UNREACHABLE