mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 08:54:53 +00:00
fix infinite recursion in term rewriting macros tests (#23979)
Noticed Hint [Pattern] spam in CI
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
discard """
|
||||
output: '''
|
||||
3
|
||||
0
|
||||
30
|
||||
true
|
||||
'''
|
||||
"""
|
||||
@@ -15,7 +15,9 @@ echo z
|
||||
|
||||
|
||||
template arithOps: untyped = (`+` | `-` | `*`)
|
||||
template testOr{ (arithOps{f})(a, b) }(a, b, f: untyped): untyped = f(a mod 10, b)
|
||||
template testOr{ (arithOps{f})(a, b) }(a, b, f: untyped): untyped =
|
||||
{.noRewrite.}:
|
||||
f(a mod 10, b)
|
||||
|
||||
let xx = 10
|
||||
echo 10*xx
|
||||
|
||||
@@ -70,7 +70,9 @@ block tstar:
|
||||
for i in 1..len(s)-1: result.add s[i]
|
||||
inc calls
|
||||
|
||||
template optConc{ `&&` * a }(a: string): string = &&a
|
||||
template optConc{ `&&` * a }(a: string): string =
|
||||
{.noRewrite.}:
|
||||
&&a
|
||||
|
||||
let space = " "
|
||||
echo "my" && (space & "awe" && "some " ) && "concat"
|
||||
|
||||
Reference in New Issue
Block a user