vlang / vlang/v

checker: `-no-parallel` with a `-prealloc` compiler skips whole-program passes (deprecated `byte` not reported, goto label errors degrade to C errors)

Open
#28,792 0 comments 0 reactions 1 assignee View on GitHub

@quaesitor-scientiam is already working on this.

Since Sep 19, 2026.

Bug
Dominant language
V
Stars
37.9k
Forks
2.3k
Avg merge
17h 8m
Merged PRs (30d)
448

Description

Describe the bug

With -no-parallel, a -prealloc compiler (what v self builds) runs TypeChecker.check_semantics_scoped_serial instead of check_semantics, and that path does not run several whole-program passes of check_semantics. Two visible consequences:

  • byte(1) compiles without the byte is deprecated, use u8 instead error.
  • goto nowhere is no longer reported by the checker (unknown label); the C compiler reports it instead (label '__v_user_goto_0' used but not defined).

check_semantics (vlib/v/types/checker.v) runs check_import_diagnostics, check_c_js_generic_declarations, check_duplicate_fn_declarations, check_deprecated_byte_types, check_interface_reserved_parameter_names, check_goto_labels and check_labelled_loop_controls. check_semantics_scoped_serial (vlib/v/types/checker_parallel.v) runs check_export_attrs, check_top_level_declarations and the scoped batches; none of the others are referenced from checker_parallel.v. Some are evidently covered elsewhere (a duplicate fn is still reported), check_deprecated_byte_types and check_goto_labels are not.

The selection happens in the !want_parallel branch: if tc.scope_parallel_check_workers { tc.check_semantics_scoped_serial() } else { tc.check_semantics() }, and scope_parallel_check_workers is set by enable_scoped_parallel_workers() when the driver's should_scope_prealloc_stages() ($if prealloc) is true.

Because the diagnostic fixture harness (vlib/v/fixturetest) always passes -no-parallel, the three vlib/v/checker/tests/use_byte_instead_of_u8_*_err.vv fixtures produce no error at all under a -prealloc compiler.

Reproduction Steps

fn main() {
	x := byte(1)
	println(x)
}
v -o out byte_type.v                # error: byte is deprecated, use u8 instead
v -no-parallel -o out byte_type.v   # compiles, exit 0
fn main() {
	unsafe {
		goto nowhere
	}
}
v -o out goto_missing.v                # goto_missing.v:3:8: error: unknown label `nowhere`
v -no-parallel -o out goto_missing.v   # C compiler: label '__v_user_goto_0' used but not defined

Expected Behavior

-no-parallel only changes scheduling; the same diagnostics are produced as in the default mode.

Current Behavior

See above: the deprecated-byte error is dropped entirely, the goto-label error degrades to a C compiler error.

Possible Solution

Run the whole-program passes that check_semantics runs (or the subset not covered elsewhere — at least check_deprecated_byte_types and check_goto_labels) from check_semantics_scoped_serial as well, or factor them into a helper both entry points call. check_semantics_parallel should be audited for the same gap.

Additional Information/Context

Found while adding a byte-in-asm fixture for #28764: the fixture (and the existing use_byte_instead_of_u8_*_err.vv ones) cannot be validated by the harness on a -prealloc compiler.

V version

V 0.5.2 01a8af9 (master, 2026-09-18)

Environment details

Windows 11 amd64, tcc; v.exe built by v self (prealloc).

[!NOTE]
You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.