* enable stricteffects * add gcsafe * fix tests * use func * fixes pegs tests * explicitly mark repr related procs with noSideEffect * add nimLegacyEffects * change URL * fixes docopt * add `raises: []` to repr * fixes weave * fixes nimyaml * fixes glob * fixes parsetoml * Apply suggestions from code review * Update testament/important_packages.nim * add legacy:laxEffects
This commit is contained in:
parent
0510a2be0d
commit
1e15f975b8
16 changed files with 38 additions and 39 deletions
|
|
@ -21,7 +21,7 @@ createMenuItem(s, "Go to definition...",
|
|||
)
|
||||
|
||||
|
||||
proc noRaise(x: proc()) {.raises: [].} =
|
||||
proc noRaise(x: proc()) {.raises: [], effectsOf: x.} =
|
||||
# unknown call that might raise anything, but valid:
|
||||
x()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
discard """
|
||||
errormsg: "'mainUnsafe' is not GC-safe"
|
||||
errormsg: "'mainUnsafe' is not GC-safe as it performs an indirect call here"
|
||||
line: 26
|
||||
cmd: "nim $target --hints:on --threads:on $options $file"
|
||||
"""
|
||||
|
|
@ -13,7 +13,7 @@ proc myproc(i: int) {.gcsafe.} =
|
|||
if isNil(global_proc):
|
||||
return
|
||||
|
||||
proc mymap(x: proc ()) =
|
||||
proc mymap(x: proc ()) {.effectsOf: x.} =
|
||||
x()
|
||||
|
||||
var
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
block: # `.noSideEffect`
|
||||
func foo(bar: proc(): int): int = bar()
|
||||
func foo(bar: proc(): int): int {.effectsOf: bar.} = bar()
|
||||
var count = 0
|
||||
proc fn1(): int = 1
|
||||
proc fn2(): int = (count.inc; count)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue