mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-02 12:04:44 +00:00
fixes #24472 Excluding variables which are initialized in the nimvm branch so that they won't interfere the other branch
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
discard """
|
||||
targets: "cpp"
|
||||
output: "hello"
|
||||
cmd: "nim cpp --legacy:nostrictdefs --clearNimblePath --nimblePath:build/deps/pkgs2 $file"
|
||||
cmd: "nim cpp --clearNimblePath --nimblePath:build/deps/pkgs2 $file"
|
||||
"""
|
||||
|
||||
# bug #3299
|
||||
|
||||
@@ -83,3 +83,21 @@ proc foo2 =
|
||||
doAssert z == 3
|
||||
|
||||
foo2()
|
||||
|
||||
# bug #24472
|
||||
template bar1314(): bool =
|
||||
let hello = true
|
||||
hello
|
||||
|
||||
template foo1314*(val: bool): bool =
|
||||
when nimvm:
|
||||
val
|
||||
else:
|
||||
val
|
||||
|
||||
proc test() = # Doesn't fail when top level
|
||||
# Original code is calling `unlikely` which has a `nimvm` branch
|
||||
let s = foo1314(bar1314())
|
||||
doAssert s
|
||||
|
||||
test()
|
||||
|
||||
Reference in New Issue
Block a user