stage1 禁止隐式调用 修复bug

This commit is contained in:
zzy
2026-07-12 11:43:27 +08:00
parent 118c153280
commit 9b9b25ce0f
5 changed files with 23 additions and 17 deletions

View File

@@ -318,6 +318,9 @@ static void parse_type_body(spl_comp_t *ctx, spl_type_info_t *container, int is_
if (peek(ctx)->type == TOK_SEMICOLON || peek(ctx)->type == TOK_COMMA)
advance(ctx);
} else if (tt == KW_FN && depth == 1) {
/* Compute layout before compiling methods so
* field offsets are correct during codegen */
spl_type_compute_layout(container);
parse_method_decl(ctx, container);
} else {
advance(ctx);