summary refs log tree commit diff stats
path: root/tests/stylecheck/treject.nim
diff options
context:
space:
mode:
authorflywind <xzsflywind@gmail.com>2022-01-10 17:29:04 +0800
committerGitHub <noreply@github.com>2022-01-10 10:29:04 +0100
commit92e5573b20f30f4114a4eb1f35eddc7064bfcd71 (patch)
treef5d142e157ca57da6fa378570e089088e185b8ca /tests/stylecheck/treject.nim
parent955040f0f1d4f9b2eab68c385fab9d4cfbef8ea5 (diff)
downloadNim-92e5573b20f30f4114a4eb1f35eddc7064bfcd71.tar.gz
fix stylecheck error with asyncdispatch (#19350)
* stylecheck usages part two: stdlib cleanup

typeinfo.nim: importCompilerProc => importcompilerproc

nre.nim: newLineFlags => newlineFlags

system.nim: JSRoot => JsRoot

ref #19319

* prefer importCompilerProc

* fix stylecheck error with asyncdispatch

it is a partial regression since #12842

* add tests

* don't use echo in tests
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