summary refs log tree commit diff stats
path: root/tests/template/tconfusinglocal.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/template/tconfusinglocal.nim')
-rw-r--r--tests/template/tconfusinglocal.nim21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/template/tconfusinglocal.nim b/tests/template/tconfusinglocal.nim
new file mode 100644
index 000000000..9f641e2bf
--- /dev/null
+++ b/tests/template/tconfusinglocal.nim
@@ -0,0 +1,21 @@
+discard """
+output: "0"
+"""
+
+
+# bug #5135
+proc fail*[E](e: E): void =
+  raise newException(Exception, e)
+
+# bug #4875
+type Bar = object
+    mFoo: int
+
+template foo(a: Bar): int = a.mFoo
+
+proc main =
+    let foo = 5 # Rename this to smth else to make it work
+    var b: Bar
+    echo b.foo
+
+main()