fix infinite recursion in term rewriting macros tests (#23979)

Noticed Hint [Pattern] spam in CI
This commit is contained in:
metagn
2024-08-20 12:42:14 +03:00
committed by GitHub
parent 58813a3b2e
commit 8bd0422767
2 changed files with 7 additions and 3 deletions

View File

@@ -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

View File

@@ -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"