You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found another way to trigger a compiler crash with the output: Error: internal error: expr(skModule); unknown symbol
Example:
whenisMainModule:
import std/sequtils
sequtils
Nim Version
Nim Compiler Version 2.1.1 [Linux: amd64]
Compiled at 2024-03-13
Copyright (c) 2006-2024 by Andreas Rumpf
git hash: 78c834d
active boot switches: -d:release
Current Output
$ nim r program.nim
Hint: used config file '/home/kraptor/.choosenim/toolchains/nim-#devel/config/nim.cfg' [Conf]
Hint: used config file '/home/kraptor/.choosenim/toolchains/nim-#devel/config/config.nims' [Conf]
.........................................................................
/home/kraptor/program.nim(3, 3) Error: internal error: expr(skModule); unknown symbol
No stack traceback available
To create a stacktrace, rerun compilation with './koch temp r <file>', see https://nim-lang.github.io/Nim/intern.html#debugging-the-compiler for details
Expected Output
The same error when when isMainModule: is not used (or any other useful error):
Error: expression has no type:
import
sequtils
sequtils
fixes#23399
The new case introduced in #21657 is triggered by `efWantStmt` but the
`when` statement doesn't normally propagate this flag, so propagate it
when the `semCheck` param in `semWhen` is true which happens when the
`when` statement is `efWhenStmt` anyway.
fixes#23399
The new case introduced in #21657 is triggered by `efWantStmt` but the
`when` statement doesn't normally propagate this flag, so propagate it
when the `semCheck` param in `semWhen` is true which happens when the
`when` statement is `efWhenStmt` anyway.
(cherry picked from commit fb6c805)
Description
I found another way to trigger a compiler crash with the output:
Error: internal error: expr(skModule); unknown symbol
Example:
Nim Version
Nim Compiler Version 2.1.1 [Linux: amd64]
Compiled at 2024-03-13
Copyright (c) 2006-2024 by Andreas Rumpf
git hash: 78c834d
active boot switches: -d:release
Current Output
Expected Output
The same error when
when isMainModule:
is not used (or any other useful error):Possible Solution
No response
Additional Information
Related bugs:
The text was updated successfully, but these errors were encountered: