mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 18:02:05 +00:00
* enabled explicitly unknown lock levels * allowing "unknown" as locks pragma * added test case for locks pragma * updated docs on locks pragma
14 lines
329 B
Nim
14 lines
329 B
Nim
|
|
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
|