1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

fmt: keep constant sizes in struct field fixed array types (#9910)

This commit is contained in:
Lukas Neubert
2021-04-28 21:11:15 +02:00
committed by GitHub
parent 626517f5f7
commit a065d014a2
6 changed files with 32 additions and 11 deletions

View File

@@ -42,7 +42,7 @@ pub fn (mut p Parser) parse_array_type() ast.Type {
p.error_with_pos('fixed size cannot be zero or negative', size_expr.position())
}
// sym := p.table.get_type_symbol(elem_type)
idx := p.table.find_or_register_array_fixed(elem_type, fixed_size)
idx := p.table.find_or_register_array_fixed(elem_type, fixed_size, size_expr)
if elem_type.has_flag(.generic) {
return ast.new_type(idx).set_flag(.generic)
}