Posix.sendto causes "panic: reached unreachable code" on Windows

I think both of those are good ideas: figure out what’s going on with your code, if you can, because the reason that unreachable is triggered may well be that something incorrect on your end is happening, in the process of moving it to its own function.

But “runtime code reached unreachable in the standard library” is itself a bug, so you either have “this code should be correct but isn’t” or you have “this is buggy code but it also triggers an unreachable branch”, and once you figure out which is which, I encourage you to add it to the tracker. There are a few variations already, but yours is likely to be new, because the nature of the problem is that there are a great many ‘unreachable’ branches in std.posix. If you do find an identical issue, adding a comment to it is appropriate as well.

I know the core team needs to prioritize their time, my hope with all this is that a basic design which doesn’t have the problem can get worked out, and moved into the “accepted” “contributor friendly” stage of the process. I would gladly dedicate a few hours of some weekend to fixing this up, but it’s not entirely clear to me what should be done.

1 Like