Skip to content

compiler/types: Fix array name dimension flipping for unsized arrays

Rewrite the code to use linear_asprintf and always flip the dimensions in place if the element type is an array. The new code will now (correctly) flip even in the case of unsized arrays.

The flipping is done by swapping the ranges [a, b) and [b, c), as shown below, with element type int[...] and an array of length 4.

           +--------------- a: first bracket in the name
           |    +---------- b: end of the element name
           |    |  +------- c: end of the array name
           |    |  |
        int[...][4]$

will be transformed into

        int[4][...]$
Edited by Caio Oliveira

Merge request reports