summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/commands.nim4
-rw-r--r--compiler/options.nim1
-rw-r--r--doc/advopt.txt2
-rw-r--r--doc/manual.rst5
-rw-r--r--tests/system/tuse_version.nim5
-rw-r--r--tests/system/tuse_version16.nim49
6 files changed, 57 insertions, 9 deletions
diff --git a/compiler/commands.nim b/compiler/commands.nim
index 8e1d96860..b21b48801 100644
--- a/compiler/commands.nim
+++ b/compiler/commands.nim
@@ -1043,6 +1043,10 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
       defineSymbol(conf.symbols, "NimMajor", "1")
       defineSymbol(conf.symbols, "NimMinor", "2")
       conf.globalOptions.incl optNimV12Emulation
+    of "1.6":
+      defineSymbol(conf.symbols, "NimMajor", "1")
+      defineSymbol(conf.symbols, "NimMinor", "6")
+      conf.globalOptions.incl optNimV16Emulation
     else:
       localError(conf, info, "unknown Nim version; currently supported values are: `1.0`, `1.2`")
     # always be compatible with 1.x.100:
diff --git a/compiler/options.nim b/compiler/options.nim
index 5cfe58119..9c0c9df72 100644
--- a/compiler/options.nim
+++ b/compiler/options.nim
@@ -96,6 +96,7 @@ type                          # please make sure we have under 32 options
     optPanics                 # turn panics (sysFatal) into a process termination
     optNimV1Emulation         # emulate Nim v1.0
     optNimV12Emulation        # emulate Nim v1.2
+    optNimV16Emulation        # emulate Nim v1.6
     optSourcemap
     optProfileVM              # enable VM profiler
     optEnableDeepCopy         # ORC specific: enable 'deepcopy' for all types.
diff --git a/doc/advopt.txt b/doc/advopt.txt
index e27c75ada..0a2349597 100644
--- a/doc/advopt.txt
+++ b/doc/advopt.txt
@@ -161,7 +161,7 @@ Advanced options:
                             enable experimental language feature
   --legacy:$2
                             enable obsolete/legacy language feature
-  --useVersion:1.0|1.2      emulate Nim version X of the Nim compiler, for testing
+  --useVersion:1.0|1.2|1.6  emulate Nim version X of the Nim compiler, for testing
   --benchmarkVM:on|off      turn benchmarking of VM code with cpuTime() on|off
   --profileVM:on|off        turn compile time VM profiler on|off
   --sinkInference:on|off    turn sink parameter inference on|off (default: on)
diff --git a/doc/manual.rst b/doc/manual.rst
index e45133c38..4c4b9c506 100644
--- a/doc/manual.rst
+++ b/doc/manual.rst
@@ -5797,11 +5797,6 @@ However, this means that the method call syntax is not available for
   tmp(12)
 
 
-**Note**: The Nim compiler prior to version 1 was more lenient about this
-requirement. Use the `--useVersion:0.19`:option: switch for a transition period.
-
-
-
 Limitations of the method call syntax
 -------------------------------------
 
diff --git a/tests/system/tuse_version.nim b/tests/system/tuse_version.nim
index 36dac46ec..116ef3596 100644
--- a/tests/system/tuse_version.nim
+++ b/tests/system/tuse_version.nim
@@ -1,6 +1,5 @@
 discard """
-  cmd: "nim c --useVersion:1.0 -r $file"
-  output: "1.0.100"
+  matrix: "--useVersion:1.0"
 """
 
 {.warning[UnusedImport]: off.}
@@ -47,4 +46,4 @@ import std/[
 ]
 
 
-echo NimVersion
+doAssert NimVersion == "1.0.100"
diff --git a/tests/system/tuse_version16.nim b/tests/system/tuse_version16.nim
new file mode 100644
index 000000000..d5430db32
--- /dev/null
+++ b/tests/system/tuse_version16.nim
@@ -0,0 +1,49 @@
+discard """
+  matrix: "--useVersion:1.6"
+"""
+
+{.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,
+]
+
+
+doAssert NimVersion == "1.6.100"