summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2021-07-21 09:46:18 +0200
committerGitHub <noreply@github.com>2021-07-21 09:46:18 +0200
commit9c2442af94fc3db8486ee16e82ea27752e9ae4f5 (patch)
treeb4562ac9ae278e6c89ce49a5f33f2e071c0487f0 /lib
parentb6f9f7a33eb550a75350c2bce8423269734bb185 (diff)
downloadNim-9c2442af94fc3db8486ee16e82ea27752e9ae4f5.tar.gz
unary slices get a deprecation period (#18549)
Diffstat (limited to 'lib')
-rw-r--r--lib/system.nim17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/system.nim b/lib/system.nim
index 1da1444d2..e6a2439df 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -511,15 +511,14 @@ proc `..`*[T, U](a: sink T, b: sink U): HSlice[T, U] {.noSideEffect, inline, mag
   ##   echo a[2 .. 3] # @[30, 40]
   result = HSlice[T, U](a: a, b: b)
 
-when defined(nimLegacyUnarySlice):
-  proc `..`*[T](b: sink T): HSlice[int, T]
-    {.noSideEffect, inline, magic: "DotDot", deprecated: "replace `..b` with `0..b`".} =
-    ## Unary `slice`:idx: operator that constructs an interval `[default(int), b]`.
-    ##
-    ## .. code-block:: Nim
-    ##   let a = [10, 20, 30, 40, 50]
-    ##   echo a[.. 2] # @[10, 20, 30]
-    result = HSlice[int, T](a: 0, b: b)
+proc `..`*[T](b: sink T): HSlice[int, T]
+  {.noSideEffect, inline, magic: "DotDot", deprecated: "replace `..b` with `0..b`".} =
+  ## Unary `slice`:idx: operator that constructs an interval `[default(int), b]`.
+  ##
+  ## .. code-block:: Nim
+  ##   let a = [10, 20, 30, 40, 50]
+  ##   echo a[.. 2] # @[10, 20, 30]
+  result = HSlice[int, T](a: 0, b: b)
 
 when defined(hotCodeReloading):
   {.pragma: hcrInline, inline.}