selfhost: for-in support for Channel<T>; fix break/continue C codegen

- lib/Channel.bux: add Channel_Recv_Ok<T> for use in for-in desugaring
- hir_lower.bux: Channel for-in desugars to while+recv_ok pattern
- c_backend.bux: emit 'break;' / 'continue;' with semicolon, fix missing
  semicolon when break/continue inside if-block
- bootstrap/hir_lower.nim: skip generic methods in vtable generation to
  avoid referencing non-existent monomorphized C functions
This commit is contained in:
2026-06-10 13:46:06 +03:00
parent 7d6cf7f511
commit 0b887b92d3
4 changed files with 110 additions and 4 deletions
+4
View File
@@ -24,6 +24,10 @@ func Channel_Recv<T>(ch: *Channel<T>) -> T {
return result;
}
func Channel_Recv_Ok<T>(ch: *Channel<T>, out: *T) -> bool {
return bux_channel_recv(ch.handle, out as *void) != 0;
}
func Channel_Close<T>(ch: *Channel<T>) {
bux_channel_close(ch.handle);
}