diff options
-rw-r--r-- | tests/iter/titer_issues.nim | 15 | ||||
-rw-r--r-- | tests/pragmas/tcustom_pragma.nim | 25 |
2 files changed, 36 insertions, 4 deletions
diff --git a/tests/iter/titer_issues.nim b/tests/iter/titer_issues.nim index 872ebe2b7..4a76b2fb0 100644 --- a/tests/iter/titer_issues.nim +++ b/tests/iter/titer_issues.nim @@ -27,6 +27,8 @@ end 9014 9016 9018 +@[1, 2] +@[1, 2, 3] ''' """ @@ -191,7 +193,7 @@ block t3499_keepstate: break # bug #3499 last snippet fixed - # bug 705 last snippet fixed + # bug #705 last snippet fixed @@ -225,7 +227,7 @@ block t2023_objiter: block: - # issue #13739 + # bug #13739 iterator myIter(arg: openarray[int]): int = var tmp = 0 let len = arg.len @@ -240,3 +242,12 @@ block: echo x someProc() + +block: + # bug #12576 + iterator ff(sq: varargs[seq[int]]): int = + for x in sq: + echo x + + for x in ff(@[1, 2], @[1, 2, 3]): + echo x diff --git a/tests/pragmas/tcustom_pragma.nim b/tests/pragmas/tcustom_pragma.nim index b306045e0..756396529 100644 --- a/tests/pragmas/tcustom_pragma.nim +++ b/tests/pragmas/tcustom_pragma.nim @@ -336,7 +336,7 @@ ProcDef static: assert bar("x") == "x" #------------------------------------------------------ -# issue #13909 +# bug #13909 template dependency*(id: string, weight = 0.0) {.pragma.} @@ -345,4 +345,25 @@ type provider*: proc(obj: string): pointer {.dependency("Data/" & obj, 16.1), noSideEffect.} proc myproc(obj: string): string {.dependency("Data/" & obj, 16.1).} = - result = obj \ No newline at end of file + result = obj + +# bug 12523 +template myCustomPragma {.pragma.} + +type + RefType = ref object + field {.myCustomPragma.}: int + + ObjType = object + field {.myCustomPragma.}: int + RefType2 = ref ObjType + +block: + let x = RefType() + for fieldName, fieldSym in fieldPairs(x[]): + doAssert hasCustomPragma(fieldSym, myCustomPragma) + +block: + let x = RefType2() + for fieldName, fieldSym in fieldPairs(x[]): + doAssert hasCustomPragma(fieldSym, myCustomPragma) |