else if(!current_block->parent && ptr->interface==var.interface && ptr->type==var.type)
{
if(ptr->source==BUILTIN_SOURCE)
- redeclared_builtins.push_back(&var);
- else
- stage->diagnostics.push_back(Diagnostic(Diagnostic::WARN, var.source, var.line,
- format("Redeclaring non-builtin variable '%s' is deprecated", var.name)));
+ {
+ redeclared_builtins.push_back(ptr);
+
+ if(var.layout)
+ {
+ if(ptr->layout)
+ merge_layouts(*ptr->layout, *var.layout);
+ else
+ ptr->layout = var.layout;
+ }
+ if(var.array_size)
+ ptr->array_size = var.array_size;
- if(var.init_expression)
- ptr->init_expression = var.init_expression;
- if(var.layout)
+ nodes_to_remove.insert(&var);
+ r_any_resolved = true;
+ }
+ else if(ptr->array && !ptr->array_size && !var.layout && !var.init_expression)
{
- if(ptr->layout)
- merge_layouts(*ptr->layout, *var.layout);
- else
- ptr->layout = var.layout;
+ ptr->array_size = var.array_size;
+ nodes_to_remove.insert(&var);
+ r_any_resolved = true;
}
- nodes_to_remove.insert(&var);
-
- r_any_resolved = true;
}
}