UFCS generic overload resolution (issue 0157 follow-ups): - P1-a: call planning (calls.zig) used the last-wins fn_ast_map winner while lowering reselected by receiver, so the planned result type could disagree with the dispatched function and misbox the result. Both now share selectUfcsGenericByReceiver(.., fd0). - P1-b: selection scanned module_decls globally, flagging a transitively-hidden same-named overload as a false ambiguity. Now two-tier: directly-visible authors first (ambiguity only among those), global fallback for receiver-reachable namespaced methods (e.g. Task.cancel) that defers to fd0 on a hidden tie. - P2-b: boolean specificity tied *$T with *Box($T). Now peels pointer layers so the structurally-narrower receiver wins. Scheduler (sched.sx): - P1-c: a second concurrent Task.wait overwrote the single waiter slot -> silent deadlock. Now one-awaiter-per-task loud abort. - P2-c: sleep(negative) rewound the monotonic virtual clock. Rejected loudly. (P2-a, non-generic-winner-hides-generic, did not reproduce -- the non-generic arm already falls through.) Regressions: examples/generics/0218 (receiver specificity + plan/lowering agreement), examples/concurrency/1818 (negative-sleep abort), 1819 (double-wait abort). Suite green 758/0.
16 lines
628 B
Plaintext
16 lines
628 B
Plaintext
// `sleep(ms)` rejects a NEGATIVE duration loudly — the virtual clock is
|
|
// monotonic (advances only as timers fire), so a negative deadline would rewind
|
|
// it and break every ordering contract. Regression (B1.4b review, P2-c): the
|
|
// guard aborts instead of silently arming a past deadline.
|
|
//
|
|
// aborts (exit 134) after the diagnostic — aarch64-macOS-pinned.
|
|
#import "modules/std.sx";
|
|
sched :: #import "modules/std/sched.sx";
|
|
main :: () -> i64 {
|
|
s := sched.Scheduler.init(); ps := @s;
|
|
ps.spawn(() => { ps.sleep(10); ps.sleep(-5); }); // -5 → loud abort
|
|
s.run();
|
|
print("unreachable\n");
|
|
return 0;
|
|
}
|