summary refs log tree commit diff stats
path: root/tests/stylecheck/treject.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stylecheck/treject.nim')
-rw-r--r--tests/stylecheck/treject.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/stylecheck/treject.nim b/tests/stylecheck/treject.nim
new file mode 100644
index 000000000..b9d97a58d
--- /dev/null
+++ b/tests/stylecheck/treject.nim
@@ -0,0 +1,17 @@
+discard """
+  action: reject
+  nimout: '''treject.nim(14, 13) Error: 'iD' should be: 'id' [field declared in treject.nim(9, 5)]'''
+  matrix: "--styleCheck:error --styleCheck:usages"
+"""
+
+type
+  Name = object
+    id: int
+
+template hello =
+  var iD = "string"
+  var name: Name
+  echo name.iD
+  echo iD
+
+hello()
\ No newline at end of file