Skip to content

fix #19680; check if stderr is static [backport: 1.6] #19709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/vmgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1479,7 +1479,7 @@ proc checkCanEval(c: PCtx; n: PNode) =
# proc foo() = var x ...
let s = n.sym
if {sfCompileTime, sfGlobal} <= s.flags: return
if s.importcCondVar: return
if compiletimeFFI in c.config.features and s.importcCondVar: return
if s.kind in {skVar, skTemp, skLet, skParam, skResult} and
not s.isOwnedBy(c.prc.sym) and s.owner != c.module and c.mode != emRepl:
# little hack ahead for bug #12612: assume gensym'ed variables
Expand Down
10 changes: 10 additions & 0 deletions tests/misc/tvarious1.nim
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,13 @@ echo value
var ys = @[4.1, 5.6, 7.2, 1.7, 9.3, 4.4, 3.2]
#var x = int(ys.high / 2) #echo ys[x] # Works
echo ys[int(ys.high / 2)] # Doesn't work


# bug #19680
var here = ""
when stderr is static:
doAssert false
else:
here = "works"

doAssert here == "works"