-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed as not planned
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.
Description
Zig Version
0.11.0-dev.3952+82a9d5d78
Steps to Reproduce and Observed Behavior
The following code refuses to compile on 0.11.0-dev.3952+82a9d5d78 but compiles just fine on Godbolt on 0.10.0. So, the dependency loop error if presumably false.
src/main.zig:16:1: error: dependency loop detected
const ContinuationStackType = std.BoundedArray(SmolkContinuationNative, MAX_CONTINUATION_STACK_SIZE);
const std = @import("std");
const KO_Ref = u16;
const KO_State = u16;
const KOErr = error {
GENERIC,
};
const MAX_CONTINUATION_STACK_SIZE = 8;
const ContinuationStackType = std.BoundedArray(SmolkContinuationNative, MAX_CONTINUATION_STACK_SIZE);
var kont_continuation_stack: ContinuationStackType = .{};
const SmolkPointerContinuationFunction = *const fn (pkos: *KO_State, kont_stack: *ContinuationStackType, args: SmolkContinuationNative) KOErr!SmolkContinuationNative;
const SMOLK_CONTINUATION_INITIAL_CALL_STATE = 1;
const SmolkContinuationNative = struct {
pcfn: SmolkPointerContinuationFunction,
kor_result: KO_Ref,
};
pub fn kont_fail(pkos: *KO_State, kont_stack: *ContinuationStackType, args: SmolkContinuationNative) KOErr!SmolkContinuationNative
{
_ = pkos;
_ = kont_stack;
_ = args;
std.debug.print("FAIL!\n", .{});
return KOErr.GENERIC;
}
pub fn main() !void {
try kont_continuation_stack.append(.{
.pcfn = kont_fail,
.kor_result = 0,
});
std.debug.print("Stack: {any}\n", .{kont_continuation_stack});
}
Expected Behavior
Expected to compile.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.