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
import strformat
import sugar
let val = "+"
let op: (int, int) -> int = case val:
of "+": `+`
of "/": `div`
of "*": `*`
else: raise newException(ValueError, fmt"Unhandled operator: {val}")
It's not the fault of sugar as you get the same error with:
import strformat
let val = "+"
let op: proc(x: int, y: int): int = case val:
of "+": `+`
of "/": `div`
of "*": `*`
else: raise newException(ValueError, fmt"Unhandled operator: {val}")
Error:
» nim c src/compiler.nim
Hint: used config file '/opt/homebrew/Cellar/nim/2.2.0/nim/config/nim.cfg' [Conf]
Hint: used config file '/opt/homebrew/Cellar/nim/2.2.0/nim/config/config.nims' [Conf]
........................................................................................
/opt/homebrew/Cellar/nim/2.2.0/nim/lib/system/arithmetics.nim(75, 6) Error: internal error: proc has no result symbol
No stack traceback available
To create a stacktrace, rerun compilation with './koch temp c <file>', see https://nim-lang.github.io/Nim/intern.html#debugging-the-compiler for details
Nim Version
» nim -v
Nim Compiler Version 2.2.0 [MacOSX: arm64]
Compiled at 2024-10-02
Copyright (c) 2006-2024 by Andreas Rumpf
active boot switches: -d:release -d:nimUseLinenoise
Current Output
No response
Expected Output
No response
Known Workarounds
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Description
Code that triggers compiler error:
It's not the fault of
sugar
as you get the same error with:Error:
Nim Version
Current Output
No response
Expected Output
No response
Known Workarounds
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: