mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-23 03:16:53 +00:00
This commit is contained in:
@@ -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]
|
||||
|
||||
6
tests/modules/tincludeas.nim
Normal file
6
tests/modules/tincludeas.nim
Normal file
@@ -0,0 +1,6 @@
|
||||
discard """
|
||||
errormsg: "Cannot use 'as' in 'include'."
|
||||
line: 6
|
||||
"""
|
||||
|
||||
include foobar as foo
|
||||
Reference in New Issue
Block a user