diff options
| author | Tadeo Kondrak <me@tadeo.ca> | 2020-08-19 16:35:52 -0600 |
|---|---|---|
| committer | Tadeo Kondrak <me@tadeo.ca> | 2020-08-19 16:36:22 -0600 |
| commit | 8126421d07da21f0d404ec481edfda85da0709fc (patch) | |
| tree | 42e91ac58c11b7dc521011f408498224cff1981b /src/ir.cpp | |
| parent | 759485cc328a4e6f2aba58891e86234c660797b6 (diff) | |
| download | zig-8126421d07da21f0d404ec481edfda85da0709fc.tar.gz zig-8126421d07da21f0d404ec481edfda85da0709fc.zip | |
Small fixes for @Type(.Struct)
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index b2cbe89d12..976c50b8ff 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -26203,7 +26203,7 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI ZigValue *layout_value = get_const_field(ira, source_instr->source_node, payload, "layout", 0); assert(layout_value->special == ConstValSpecialStatic); - assert(layout_value->type->id == ZigTypeIdEnum); + assert(layout_value->type == ir_type_info_get_type(ira, "ContainerLayout", nullptr)); ContainerLayout layout = (ContainerLayout)bigint_as_u32(&layout_value->data.x_enum_tag); ZigValue *fields_value = get_const_field(ira, source_instr->source_node, payload, "fields", 1); @@ -26236,7 +26236,7 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI entry->data.structure.layout = layout; entry->data.structure.special = is_tuple ? StructSpecialInferredTuple : StructSpecialNone; entry->data.structure.created_by_at_type = true; - entry->data.structure.decls_scope = create_decls_scope(ira->codegen, nullptr, nullptr, entry, entry, buf_create_from_str("a")); + entry->data.structure.decls_scope = create_decls_scope(ira->codegen, nullptr, nullptr, entry, entry, &entry->name); assert(fields_ptr->data.x_ptr.special == ConstPtrSpecialBaseArray); assert(fields_ptr->data.x_ptr.data.base_array.elem_index == 0); @@ -26245,7 +26245,7 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI assert(fields_arr->data.x_array.special == ConstArraySpecialNone); for (size_t i = 0; i < fields_len; i++) { ZigValue *field_value = &fields_arr->data.x_array.data.s_none.elements[i]; - assert(field_value->type->id == ZigTypeIdStruct); + assert(field_value->type == ir_type_info_get_type(ira, "StructField", nullptr)); TypeStructField *field = entry->data.structure.fields[i]; field->name = buf_alloc(); if ((err = get_const_field_buf(ira, source_instr->source_node, field_value, "name", 0, field->name))) |
