mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-31 10:22:15 +00:00
Add nkFastAsgn into semExpr (#20939)
* Add nkFastAsgn into case statement
* Add test case
(cherry picked from commit d26b1232ee)
This commit is contained in:
@@ -3005,7 +3005,7 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
|
||||
# the node is left intact for now
|
||||
discard
|
||||
of nkStaticExpr: result = semStaticExpr(c, n[0])
|
||||
of nkAsgn: result = semAsgn(c, n)
|
||||
of nkAsgn, nkFastAsgn: result = semAsgn(c, n)
|
||||
of nkBlockStmt, nkBlockExpr: result = semBlock(c, n, flags)
|
||||
of nkStmtList, nkStmtListExpr: result = semStmtList(c, n, flags)
|
||||
of nkRaiseStmt: result = semRaise(c, n)
|
||||
|
||||
12
tests/magics/t20938.nim
Normal file
12
tests/magics/t20938.nim
Normal file
@@ -0,0 +1,12 @@
|
||||
discard """
|
||||
cmd: "nim c --mm:refc $file"
|
||||
action: "compile"
|
||||
"""
|
||||
|
||||
template foo(x: typed) =
|
||||
discard x
|
||||
|
||||
foo:
|
||||
var x = "hello"
|
||||
x.shallowCopy("test")
|
||||
true
|
||||
Reference in New Issue
Block a user