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.nim18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/effects/tsidee1.nim b/tests/effects/tsidee1.nim
new file mode 100644
index 000000000..bd5b32dd7
--- /dev/null
+++ b/tests/effects/tsidee1.nim
@@ -0,0 +1,18 @@
+discard """
+  file: "tsidee1.nim"
+  line: 12
+  errormsg: "\'SideEffectLyer\' can have side effects"
+"""
+
+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) 
+
+
+