Merge branch 'devel' into faster-nimsuggest
This commit is contained in:
commit
ac3b312cc6
13 changed files with 135 additions and 25 deletions
16
tests/ccgbugs/tmangle_field.nim
Normal file
16
tests/ccgbugs/tmangle_field.nim
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
discard """
|
||||
"""
|
||||
|
||||
# bug #5404
|
||||
|
||||
import parseopt2
|
||||
|
||||
{.emit: """typedef struct {
|
||||
int key;
|
||||
} foo;""".}
|
||||
|
||||
type foo* {.importc: "foo", nodecl.} = object
|
||||
key* {.importc: "key".}: cint
|
||||
|
||||
for kind, key, value in parseopt2.getopt():
|
||||
discard
|
||||
13
tests/pragmas/tlocks.nim
Normal file
13
tests/pragmas/tlocks.nim
Normal file
|
|
@ -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
|
||||
13
tests/pragmas/tused.nim
Normal file
13
tests/pragmas/tused.nim
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
discard """
|
||||
output: '''8'''
|
||||
"""
|
||||
|
||||
template implementArithOps(T) =
|
||||
proc echoAdd(a, b: T) {.used.} =
|
||||
echo a + b
|
||||
proc echoSub(a, b: T) {.used.} =
|
||||
echo a - b
|
||||
|
||||
# no warning produced for the unused 'echoSub'
|
||||
implementArithOps(int)
|
||||
echoAdd 3, 5
|
||||
Loading…
Add table
Add a link
Reference in a new issue