mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fix issue where type wasn't canonical. Addresses #957
This commit is contained in:
@@ -310,6 +310,10 @@ fn void Object.set_object_at(&self, usz index, Object* to_set)
|
||||
self.array.set_at(index, to_set);
|
||||
}
|
||||
|
||||
/**
|
||||
* @require $Type.kindof.is_int() "Expected an integer type."
|
||||
* @checked ($Type)1.0 "Expected an integer type."
|
||||
**/
|
||||
macro get_integer_value(Object* value, $Type)
|
||||
{
|
||||
if (value.is_float())
|
||||
@@ -328,8 +332,10 @@ macro get_integer_value(Object* value, $Type)
|
||||
return ($Type)value.i;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @require self.is_indexable()
|
||||
* @require $Type.kindof.is_int() : "Expected an integer type"
|
||||
**/
|
||||
macro Object.get_integer_at(&self, $Type, usz index) @private
|
||||
{
|
||||
@@ -338,6 +344,7 @@ macro Object.get_integer_at(&self, $Type, usz index) @private
|
||||
|
||||
/**
|
||||
* @require self.is_keyable()
|
||||
* @require $Type.kindof.is_int() : "Expected an integer type"
|
||||
**/
|
||||
macro Object.get_integer(&self, $Type, String key) @private
|
||||
{
|
||||
|
||||
@@ -3064,7 +3064,7 @@ static inline bool sema_expr_analyse_member_access(SemaContext *context, Expr *e
|
||||
return true;
|
||||
case TYPE_PROPERTY_KINDOF:
|
||||
case TYPE_PROPERTY_SIZEOF:
|
||||
return sema_expr_rewrite_to_type_property(context, expr, decl->type, type_property, decl->type);
|
||||
return sema_expr_rewrite_to_type_property(context, expr, decl->type->canonical, type_property, decl->type->canonical);
|
||||
case TYPE_PROPERTY_ELEMENTS:
|
||||
case TYPE_PROPERTY_EXTNAMEOF:
|
||||
case TYPE_PROPERTY_PARAMS:
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define COMPILER_VERSION "0.4.620"
|
||||
#define COMPILER_VERSION "0.4.621"
|
||||
Reference in New Issue
Block a user