Repository navigation
feat(lint): strict ABL M6 slice 1: CL003 signature-mismatch and CL004 unresolved-call - #244
Merged
Merged
Conversation
Add ProgramSignatures, the parameters a file's main block and its internal procedures define, with their mode, kind and primitive type. A list is Unknown when an include, an &IF or a loop may change it. WorkspaceIndex gains two queries with defaults that answer Unknown: signature (the list of a program or one of its procedures) and workspace_defines_procedure (whether a file of the workspace defines a procedure of that name). run_miss_is_reported and run_target_climbs_out expose the rule that LINT0001 keeps for a missing RUN target.
BatchIndex reads the parameter lists of a file when a rule first asks, from the expanded text when an include may hold a parameter, and marks a list that an include supplies. The daemon answers the same question with one tracked query per file that registers the include files it read. SharedProducers and a seeded BatchIndex also list the procedure names of the workspace, read once on the first question, following the include files that the files name. A run that asks neither reads nothing.
CL003 compares the arguments of a static RUN with the parameters of a callee that is known whole: the count, the kind (TABLE, BUFFER, DATASET), the mode, an expression passed as OUTPUT, and a handle against a type it does not convert to. CL004 reports a RUN of a name that is neither a procedure of the file, nor a program on the search paths, nor a procedure that any file of the workspace defines. LINT0001 keeps the targets that name a file, so no RUN is reported twice. Both are preview rules in the opt-in strict.calls group, Warning, and compute nothing with the group off.
Section 10 of the strict-analysis open questions marks how RUN matches arguments to parameters, which RUN targets the rules judge, where a parameter list comes from, and how CL004 divides the missing-target cases with LINT0001. The calls_corpus example counts both rules per directory.
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.
Strict ABL M6, slice 1: CL003 signature-mismatch and CL004 unresolved-call (group
strict.calls, preview, Warning, opt-in).docs/design/strict-analysis-open-questions.md§10, with confidence marks: howRUNmatches arguments to parameters (positional; INPUT / OUTPUT / INPUT-OUTPUT; TABLE, TABLE-HANDLE, DATASET, DATASET-HANDLE and BUFFER parameters; APPEND, BY-REFERENCE, BIND; data-type conversions; compile-time vs run-time errors), internal vs external vsIN h, ASYNCHRONOUS and PERSISTENT SET.oxabl_semanticreads the parameter lists of procedures;WorkspaceIndexgainssignatureandworkspace_defines_procedure(both with defaultNone= Unknown, so additive), answered by the batch index and the daemon.RUN namewhose target the call graph says is not found; never for dynamic, handle, unexpanded or ambiguous targets, and not where LINT0001 already reports the target.RUN, the argument count, each argument's mode, and the data type where both sides are known. Unknown types never make a finding.calls_corpusexample; README rows; doc examples.Corpus (two private trees): CL003 163 / 25, CL004 16 / 9; 0 wrong in 65 triaged findings. Default
oxabl checkoutput byte-identical; nothing runs with the group off. The §10.1 matching rules are Recalled / Inferred and still need a check against a licensed compiler.cargo test --workspace(3,830), clippy-D warnings, fmt, wasm check.