'internal error: proc has no result symbol' when using operators as first-class functions
### Description

Code that triggers compiler error:
```
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_