side-effect computation now done in the proper pass; fixes #4254
This commit is contained in:
parent
82d4597e88
commit
f1e4d8ed74
4 changed files with 39 additions and 17 deletions
|
|
@ -1,13 +1,13 @@
|
|||
discard """
|
||||
file: "tsidee4.nim"
|
||||
line: 15
|
||||
errormsg: "type mismatch"
|
||||
line: 12
|
||||
errormsg: "'noSideEffect' can have side effects"
|
||||
"""
|
||||
|
||||
var
|
||||
global: int
|
||||
|
||||
proc dontcare(x: int): int = return x
|
||||
proc dontcare(x: int): int = return global
|
||||
|
||||
proc noSideEffect(x, y: int, p: proc (a: int): int {.noSideEffect.}): int {.noSideEffect.} =
|
||||
return x + y + dontcare(x)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue