xoofx/CppAst.NET

`GetDisplayName ()` for the type parsed from `const char * const *` seems to be wrong

objectx opened this issue · 0 comments

        let compilation =
            CppParser.Parse(
                """
#define TEST 1
int main (int argc, const char * const*argv) {
    return 0;
}
""",
                cppOpts
            )
        if compilation.HasErrors then
            failwithf $"compilation error: %A{compilation.Diagnostics}"
        printfn $"macros = %A{compilation.Macros}"
        printfn $"function = %A{compilation.Functions}"
        for fn in compilation.Functions do
            printfn $"name = %s{fn.Name}, return = %A{fn.ReturnType}"
            for param in fn.Parameters do
                printfn $"%s{param.Name}: %A{param.Type.TypeKind} %s{param.Type.GetDisplayName()}"

Prints following:

macros = seq [TEST = 1]
function = seq [int main(int argc, const const char** argv)]
name = main, return = int
argc: Primitive int
argv: Pointer const const char**

The argv should be printed as const char * const * but not.