ast2 fix issue 174 - UncheckedArray

This commit is contained in:
Ganesh Viswanathan 2020-04-07 20:24:04 -05:00
commit d877b20407
3 changed files with 44 additions and 8 deletions

View file

@ -133,6 +133,16 @@ void
int sqlite3_bind_blob(struct A1*, int, const void*, int n, void(*)(void*));
// Issue #174 - type name[] => UncheckedArray[type]
int ucArrFunc1(int text[]);
int ucArrFunc2(int text[][5], int (*func)(int text[]));
typedef int ucArrType1[][5];
struct ucArrType2 {
float f1[5][5];
int *f2[][5];
};

View file

@ -335,3 +335,15 @@ assert absfunptr5 is proc(a1: proc(a1: ptr A4): cint {.cdecl.}) {.cdecl.}
assert sqlite3_bind_blob is
proc(a1: ptr A1, a2: cint, a3: pointer, n: cint, a5: proc(a1: pointer) {.cdecl.}): cint {.cdecl.}
# Issue #174 - type name[] => UncheckedArray[type]
assert ucArrFunc1 is proc(text: UncheckedArray[cint]): cint {.cdecl.}
assert ucArrFunc2 is
proc(text: UncheckedArray[array[5, cint]], `func`: proc(text: UncheckedArray[cint]): cint {.cdecl.}): cint {.cdecl.}
assert ucArrType1 is UncheckedArray[array[5, cint]]
checkPragmas(ucArrType1, pHeaderImp)
assert ucArrType2 is object
testFields(ucArrType2, "f1|f2:array[5, array[5, cfloat]]|UncheckedArray[array[5, ptr cint]]")
checkPragmas(ucArrType2, pHeaderBy, istype = false)