Files
bux-lang/examples/concurrency.bux
T
dimgigov 5ae85d5bd9 Phase 2: Fix sema stub — add full function body type checking
- Iterate function body statements and call Sema_CheckStmt on each
- Add Sema_CheckBlock helper for child scope creation in if/while/for/loop blocks
- Extend Sema_CheckStmt to handle all statement kinds: skIf, skWhile, skDoWhile,
  skLoop, skFor, skMatch, skBreak, skContinue, skDecl, skReturn
- Extend Sema_CheckExpr with ekAssign, ekField, ekIndex, ekBlock, ekSelf
- Fix ekCall to resolve return type from function declaration
- Fix ekBinary to handle assignment operators (tkAssign, +=, -=, etc.)
- Add Sema_CollectGlobals handling for dkUse (imports), dkConst, dkEnum variants
- Add tkColonColon path parsing in parser (Color::Red)
- Add decl field to Symbol struct for function/type resolution
- Add Sema_ZeroInitSymbol helper to avoid garbage from uninitialized struct fields
- Fix concurrency.bux missing Task_Join import

All examples now pass buxc2 check. make selfhost succeeds.
2026-06-05 14:07:38 +03:00

17 lines
378 B
Plaintext

import Std::Io::{PrintLine, PrintInt};
import Std::Task::TaskHandle;
import Std::Task::Task_Join;
import Std::Channel::Channel;
func Worker(arg: *void) -> *void {
PrintLine("Hello from thread!");
return null;
}
func Main() -> int {
let handle: *void = spawn Worker();
Task_Join(TaskHandle { handle: handle });
PrintLine("Thread finished");
return 0;
}