summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authornc-x <neelesh.chandola@outlook.com>2019-08-17 23:15:47 +0530
committerAndreas Rumpf <rumpf_a@web.de>2019-08-17 19:45:47 +0200
commitb68380f09b1926f4aea89b14b52bb442d5b002de (patch)
tree26c122e1f947888bc9b311c02d448be70d50c7a3 /compiler
parentdb9e27dffd266c0a69ac3d3544fb9aa563676096 (diff)
downloadNim-b68380f09b1926f4aea89b14b52bb442d5b002de.tar.gz
fixes #11872; include now gives a proper error message for all invalid infix operators (#11965)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semstmts.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index ba88a6359..07aaf0eca 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -2035,6 +2035,8 @@ proc evalInclude(c: PContext, n: PNode): PNode =
   for i in 0 ..< sonsLen(n):
     var imp: PNode
     let it = n.sons[i]
+    if it.kind == nkInfix and it.len == 3 and it[0].ident.s != "/":
+      localError(c.config, it.info, "Cannot use '" & it[0].ident.s & "' in 'include'.")
     if it.kind == nkInfix and it.len == 3 and it[2].kind == nkBracket:
       let sep = it[0]
       let dir = it[1]