summary refs log tree commit diff stats
path: root/tests/effects/tsidee1.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/effects/tsidee1.nim')
-rw-r--r--tests/effects/tsidee1.nim15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/effects/tsidee1.nim b/tests/effects/tsidee1.nim
new file mode 100644
index 000000000..ca6816561
--- /dev/null
+++ b/tests/effects/tsidee1.nim
@@ -0,0 +1,15 @@
+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)