summary refs log tree commit diff stats
path: root/compiler/semmagic.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-03-28 00:15:04 +0100
committerAraq <rumpf_a@web.de>2015-03-28 00:15:04 +0100
commit2b80d75aa298f490aedb8970b877f3edd7fd4bab (patch)
tree95022d7a26152ed2f1a28bf5c577643a612a4673 /compiler/semmagic.nim
parent46fb0e0bac2b5aa79e495bea11f48e33d372033c (diff)
downloadNim-2b80d75aa298f490aedb8970b877f3edd7fd4bab.tar.gz
fixes #2420; negative indexing for slicing is obsolete (breaking change!)
Diffstat (limited to 'compiler/semmagic.nim')
-rw-r--r--compiler/semmagic.nim8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim
index 56746ce26..de7700be6 100644
--- a/compiler/semmagic.nim
+++ b/compiler/semmagic.nim
@@ -167,10 +167,10 @@ proc magicsAfterOverloadResolution(c: PContext, n: PNode,
     result.typ = n[1].typ
   of mDotDot:
     result = n
-    # we only need to warnings here about negative indexing:
-    if isNegative(n.sons[1]) or (n.len > 2 and isNegative(n.sons[2])):
-      message(n.info, warnDeprecated,
-        "use '^' instead of '-'; negative indexing")
+    # disallow negative indexing for now:
+    if not c.p.bracketExpr.isNil:
+      if isNegative(n.sons[1]) or (n.len > 2 and isNegative(n.sons[2])):
+        localError(n.info, "use '^' instead of '-'; negative indexing is obsolete")
   of mRoof:
     # error correction:
     result = n.sons[1]