diff options
author | Fabian Keller <bluenote10@users.noreply.github.com> | 2017-02-20 09:31:52 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-02-20 09:31:52 +0100 |
commit | ce4587d7b721839ffa8ed4c9d1c2abd8f308f99d (patch) | |
tree | 3760aa6beb11ac7b115288630972e8fd47045d42 /tests/pragmas/tlocks.nim | |
parent | 363b1c0a41e4b554c46d8aa5af5ad1ed31523628 (diff) | |
download | Nim-ce4587d7b721839ffa8ed4c9d1c2abd8f308f99d.tar.gz |
Enabled explicitly unknown lock levels (#5409)
* enabled explicitly unknown lock levels * allowing "unknown" as locks pragma * added test case for locks pragma * updated docs on locks pragma
Diffstat (limited to 'tests/pragmas/tlocks.nim')
-rw-r--r-- | tests/pragmas/tlocks.nim | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/pragmas/tlocks.nim b/tests/pragmas/tlocks.nim new file mode 100644 index 000000000..ba66a2dca --- /dev/null +++ b/tests/pragmas/tlocks.nim @@ -0,0 +1,13 @@ + +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 |