mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-29 18:11:44 +00:00
give a deprecate warning when using newPar to construct tuple expressions (#20312)
* error/deprecate when using `newPar` to construct tuple expressions * Update lib/core/macros.nim * fixes
This commit is contained in:
@@ -1073,7 +1073,12 @@ proc newStmtList*(stmts: varargs[NimNode]): NimNode =
|
||||
## Create a new statement list.
|
||||
result = newNimNode(nnkStmtList).add(stmts)
|
||||
|
||||
proc newPar*(exprs: varargs[NimNode]): NimNode =
|
||||
proc newPar*(exprs: NimNode): NimNode =
|
||||
## Create a new parentheses-enclosed expression.
|
||||
newNimNode(nnkPar).add(exprs)
|
||||
|
||||
proc newPar*(exprs: varargs[NimNode]): NimNode {.deprecated:
|
||||
"don't use newPar/nnkPar to construct tuple expressions; use nnkTupleConstr instead".} =
|
||||
## Create a new parentheses-enclosed expression.
|
||||
newNimNode(nnkPar).add(exprs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user