mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- $typeof untyped list crashes when trying to create typeid from it. #2779
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
- Vectors not converted to arrays when passed as raw vaargs. #2776
|
||||
- Second value in switch range not checked properly, causing an error on non-const values. #2777
|
||||
- Broken cast from fault to array pointer #2778.
|
||||
- $typeof untyped list crashes when trying to create typeid from it. #2779
|
||||
|
||||
### Fixes
|
||||
- Regression with npot vector in struct triggering an assert #2219.
|
||||
|
||||
@@ -4247,7 +4247,6 @@ INLINE void expr_rewrite_const_slice(Expr *expr, Type *type, ConstInitializer *i
|
||||
|
||||
INLINE void expr_rewrite_const_typeid(Expr *expr, Type *type)
|
||||
{
|
||||
ASSERT(type->type_kind != TYPE_UNTYPED_LIST);
|
||||
expr->expr_kind = EXPR_CONST;
|
||||
expr->const_expr.const_kind = CONST_TYPEID;
|
||||
expr->const_expr.typeid = type->canonical;
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
fn void a()
|
||||
{
|
||||
typeid a = $typeof({}); // #error: You cannot take the typeid of a compile time type
|
||||
var t @safeinfer = mem::new_array($typeof({}), 1); // #error: 'untyped_list' does not have a property or method 'alignof'
|
||||
}
|
||||
Reference in New Issue
Block a user