Repository navigation
#2358: Sema refuses a builtin call outside its declared BuiltinSigs arity - #2378
Merged
Merged
Conversation
…s declared BuiltinSigs row An extra argument reached MIR lowering and aborted it (BUG, exit 134: s.find(needle, from), s.len(1), xs.push(1, 2), ...); a missing one compiled silently (s.find(), xs.push(), m.insert(k)) and a.store() stored the SeqCst constant MirLower materializes for an omitted Ordering. The row Sema already resolves for the call (D110) now also bounds the count: required..=total, where required excludes an Atomic method's omittable trailing Ordering parameters (§14.17.1, #1861). A builtin with no row takes no arguments; a float math method takes arity-1 (its receiver is the first operand), matching the free form's existing check. Five compile-error fixtures pin the class; each ICE'd or passed silently before this change.
Contributor
Author
Contributor
Author
|
Battery GREEN on stack top 975e66f (seed-driven, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2358.
A builtin method call whose argument count fell outside the signature its BuiltinSigs row declares (D110) was never checked in Sema: an extra argument reached MIR lowering and aborted it (exit 134,
s.find("b", 2),s.len(1),xs.push(1, 2), …), and a missing one compiled silently (s.find(),xs.push(),m.insert(k));a.store()even stored the SeqCst constant MirLower materializes for an omitted Ordering.Sema now checks the resolved count at the call against the row it already resolves: required..=total, where required excludes an Atomic method's omittable trailing
Orderingparameters (§14.17.1, #1861 —behav_1861_atomic_default_orderingstill passes). A builtin with no row takes no arguments; a float math method takes arity−1 because its receiver is the first operand (the free form already checked;x.sqrt(2.0)silently ignored the operand).Five
test/compile_errors/err_2358_*fixtures pin the class; each ICE'd or passed silently before. Thefind(needle, from)enhancement the original script wanted is filed separately as #2377 (needs spec words).Iterate-tier evidence: stage1 (
:dev) checks all five fixtures to the exact expected diagnostics, the full 30-case wrong-arity matrix flips from ICE/silent-ok to rc=1 diagnostics with legal forms unchanged, census--diffclean. Gate/battery evidence to follow on this PR.