diff options
Diffstat (limited to 'tests/pragmas/tlocks.nim')
-rw-r--r-- | tests/pragmas/tlocks.nim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/pragmas/tlocks.nim b/tests/pragmas/tlocks.nim new file mode 100644 index 000000000..5d6fcdd9c --- /dev/null +++ b/tests/pragmas/tlocks.nim @@ -0,0 +1,12 @@ +type SomeBase* = ref object of RootObj +type SomeDerived* = ref object of SomeBase + memberProc*: proc () + +method testMethod(g: SomeBase) {.base, locks: "unknown".} = discard +method testMethod(g: SomeDerived) = + if g.memberProc != nil: + g.memberProc() + +# ensure int literals still work +proc plain*() {.locks: 0.} = + discard |