diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/include/tast2.h | 10 | ||||
| -rw-r--r-- | tests/tast2.nim | 12 |
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/include/tast2.h b/tests/include/tast2.h index 348e225..a819f5e 100644 --- a/tests/include/tast2.h +++ b/tests/include/tast2.h @@ -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]; +}; + diff --git a/tests/tast2.nim b/tests/tast2.nim index d1b0f26..f2816eb 100644 --- a/tests/tast2.nim +++ b/tests/tast2.nim @@ -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) |
