mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
16 lines
333 B
Nim
16 lines
333 B
Nim
discard """
|
|
errormsg: "\'SideEffectLyer\' can have side effects"
|
|
file: "tsidee1.nim"
|
|
line: 12
|
|
"""
|
|
|
|
var
|
|
global: int
|
|
|
|
proc dontcare(x: int): int = return x + global
|
|
|
|
proc SideEffectLyer(x, y: int): int {.noSideEffect.} = #ERROR_MSG 'SideEffectLyer' can have side effects
|
|
return x + y + dontcare(x)
|
|
|
|
echo SideEffectLyer(1, 3)
|