I have mistakenly, multiple times, sent items to a channel after initialising it but before opening it. The compiler never complained. After the program compiles and runs, it gets a SIGSEGV which I then discover my mistake.
It would be very helpful it the compiler produced an error (like the type mismatch error when you use the wrong function signature)
simplified example
var
cc:Channel[int]
cc.send 1
cc.open
This compiles without error
Hi, If I am not mistaken the recommended channels to use for multithreading is https://github.com/nim-lang/threading/blob/master/threading/channels.nim
Otherwise, as far as i know there is no compile time mechanism to determine if the channel has been opened.