summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMiran <narimiran@disroot.org>2020-07-10 16:44:12 +0200
committerGitHub <noreply@github.com>2020-07-10 16:44:12 +0200
commit371b416ac818412909243d10a66c20db3eaa23f3 (patch)
treea26eb969cd0c821a761f64ec336b988770ff6aba
parent04232d92cd401bf301a9e4cac582273356c86cfa (diff)
downloadNim-371b416ac818412909243d10a66c20db3eaa23f3.tar.gz
fix #14912, make `--useVersion:1.0` work again (#14945)
* fix #14912, make `--useVersion:1.0` work again
* a better fix
* add test
-rw-r--r--compiler/commands.nim1
-rw-r--r--tests/system/tuse_version.nim50
2 files changed, 51 insertions, 0 deletions
diff --git a/compiler/commands.nim b/compiler/commands.nim
index cbf93238f..1984c894a 100644
--- a/compiler/commands.nim
+++ b/compiler/commands.nim
@@ -878,6 +878,7 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
       defineSymbol(conf.symbols, "NimPatch", "100")
       # old behaviors go here:
       defineSymbol(conf.symbols, "nimOldRelativePathBehavior")
+      undefSymbol(conf.symbols, "nimDoesntTrackDefects")
       ast.eqTypeFlags.excl {tfGcSafe, tfNoSideEffect}
       conf.globalOptions.incl optNimV1Emulation
     else:
diff --git a/tests/system/tuse_version.nim b/tests/system/tuse_version.nim
new file mode 100644
index 000000000..36dac46ec
--- /dev/null
+++ b/tests/system/tuse_version.nim
@@ -0,0 +1,50 @@
+discard """
+  cmd: "nim c --useVersion:1.0 -r $file"
+  output: "1.0.100"
+"""
+
+{.warning[UnusedImport]: off.}
+
+import std/[
+  # Core:
+  bitops, typetraits, lenientops, macros, volatile,
+
+  # Algorithms:
+  algorithm, sequtils,
+
+  # Collections:
+  critbits, deques, heapqueue, intsets, lists, options, sets,
+  sharedlist, tables,
+
+  # Strings:
+  editdistance, wordwrap, parseutils, ropes,
+  pegs, punycode, strformat, strmisc, strscans, strtabs,
+  strutils, unicode, unidecode,
+
+  # Generic operator system services:
+  os, streams,
+
+  # Math libraries:
+  complex, math, mersenne, random, rationals, stats, sums,
+
+  # Internet protocols:
+  httpcore, mimetypes, uri,
+
+  # Parsers:
+  htmlparser, json, lexbase, parsecfg, parsecsv, parsesql, parsexml,
+
+  # XML processing:
+  xmltree, xmlparser,
+
+  # Generators:
+  htmlgen,
+
+  # Hashing:
+  base64, hashes,
+
+  # Miscellaneous:
+  colors, sugar, varints,
+]
+
+
+echo NimVersion