We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
when not defined(nimscript): reduces to when true because nimscript always runs in nimvm
when not defined(nimscript):
when true
Yes but it semantic checks the else branch. We dealt with this already. If you change this to when true you get undeclared identifier nimCmpMem
D20200524T194136
when notJSnotNims: const nimCmpMem = 1 proc cmp(x, y: string): int = when nimvm: discard else: when not defined(nimscript): discard nimCmpMem
wondering whether nim-lang#13038 would help...
[Meta] Generics/Static early symbol resolution · Issue #8677 · nim-lang/Nim
if nimct:
nim-lang#13038 (comment)
whereas this works:
when defined case2: proc c_printf(frmt: cstring): cint {.importc: "printf", header: "<stdio.h>", varargs, discardable.} proc main() = when nimvm: echo "in nimvm" else: echo "notin nimvm" c_printf("hello\n") static: main() main()
The text was updated successfully, but these errors were encountered:
see whether we can overload by nimvm vs rt:
proc fn(): int {.nimvm.} = 1 proc fn(): int {.nimvm:off.} = 2 proc main= doAssert fn() == 2 static: doAssert fn() == 1
# constant folding that is necessary for correctness of semantic pass: if callee.magic != mNone and callee.magic in ctfeWhitelist and n.typ != nil:
Sorry, something went wrong.
No branches or pull requests
this issue is nasty
D20200524T194136
wondering whether nim-lang#13038 would help...
links
[Meta] Generics/Static early symbol resolution · Issue #8677 · nim-lang/Nim
example where my previous proposed
if nimct:
doens't work:nim-lang#13038 (comment)
whereas this works:
The text was updated successfully, but these errors were encountered: