mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
$typeof(<type>) returns typeinfo, causing errors #2795
This commit is contained in:
@@ -6900,7 +6900,6 @@ static inline bool sema_expr_analyse_cast(SemaContext *context, Expr *expr, bool
|
||||
{
|
||||
RETURN_SEMA_ERROR(type_info, "Casting to an optional type is not allowed.");
|
||||
}
|
||||
|
||||
if (invalid_cast_ref)
|
||||
{
|
||||
if (!cast_explicit_silent(context, inner, target_type))
|
||||
|
||||
@@ -341,10 +341,12 @@ INLINE bool sema_resolve_typeof(SemaContext *context, TypeInfo *type_info)
|
||||
{
|
||||
case STORAGE_ERROR:
|
||||
return false;
|
||||
case STORAGE_COMPILE_TIME:
|
||||
if (expr_type->type_kind == TYPE_TYPEINFO) expr_type = type_typeid;
|
||||
FALLTHROUGH;
|
||||
case STORAGE_NORMAL:
|
||||
case STORAGE_VOID:
|
||||
case STORAGE_UNKNOWN:
|
||||
case STORAGE_COMPILE_TIME:
|
||||
type_info->type = expr_type;
|
||||
return true;
|
||||
case STORAGE_WILDCARD:
|
||||
|
||||
Reference in New Issue
Block a user