diff options
Diffstat (limited to 'tests/pragmas')
-rw-r--r-- | tests/pragmas/tcustom_pragma.nim | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/pragmas/tcustom_pragma.nim b/tests/pragmas/tcustom_pragma.nim index a5f86b54d..d7b199a22 100644 --- a/tests/pragmas/tcustom_pragma.nim +++ b/tests/pragmas/tcustom_pragma.nim @@ -154,3 +154,23 @@ block: let a: proc(x: int) {.defaultValue(5).} = nil static: doAssert hasCustomPragma(a.type, defaultValue) + +# bug #8371 +template thingy {.pragma.} + +type + Cardinal = enum + north, east, south, west + Something = object + a: float32 + case cardinal: Cardinal + of north: + b {.thingy.}: int + of east: + c: int + of south: discard + else: discard + +var foo: Something +foo.cardinal = north +doAssert foo.b.hasCustomPragma(thingy) == true |