Unreachable code is reached

2024-02-07 Thread PMunch
There's not really an open/closed system on this forum. Just leave it like it is.

Unreachable code is reached

2024-02-07 Thread ninovanhooff
It was something else entirely. There are multiple LevelObjectEntity's to load, some of which have a gid. That's the whole reason why gid is an Option[unint32]. So for some calls to loadGid, the code would indeed return early, while for others it would run completely. The breakpoint hit for tho

Unreachable code is reached

2024-02-06 Thread Yardanico
It's probably a bug in the debugger or the mapping from Nim lines to C, can you try adding an echo after a return and see if it prints anything? I don't think the code after the return would execute.

Unreachable code is reached

2024-02-06 Thread xigoi
You said that the value of `gid` is `{val:0, has:false}`, but in your code, `gid` is already unwrapped. Does that mean `obj.gid` is an `Option` containing another `Option`?

Unreachable code is reached

2024-02-06 Thread ninovanhooff
I feel I fundamentally don't understand something about Nim, or that the code in my editor is not actually the code that is executed. What I'm trying to achieve is an "early return pattern", where a proc exits if some precondition is not met. In this case the Option value `gid` should be presen