Repository navigation
From note: name an unrefined parameter as the unknown value's origin - #526
Conversation
A refinement error whose Expected is only about parameters of the enclosing method that are declared with no refinement now has the message note "From: <p> is a parameter of <m>(<types>) (line L) with no refinement". It restates the declaration and says nothing about callers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex review, round 1
Custom prompt asking for soundness counterexamples (programs where the note is printed but false). It found two:
Fixed (both), in b-commit "Leave out the From note for an annotated or externally refined parameter". There is no note when:
Both programs now print no note. Tests: 729 run, 0 failures. No regression test added. Each case would need a new fixture file, and the PM asked for lean tests. I'll add them if wanted. |
Clean-code reviewI audited the diff with the clean-code-principles checklist. Fixed:
Declined:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex review, round 2
Fixed in "Match a parameter's specification by its method's parameter types".
Tests: 729 run, 0 failures. Custom soundness prompt: stopped by Codex's content filter partway through, with no findings. I'll rephrase it in round 3. |
Codex review, round 3
Soundness prompt (rephrased, so the content filter let it through). It tried inner, anonymous and local classes, lambdas, constructors, records, varargs, generics and inherited specs. It found no case where the note names the wrong parameter, method or line, or calls a refined parameter unrefined. It reported two formatting differences:
Declined, both. The signature is written the way the state hints already write methods ( This ends the Codex loop for this PR: nothing relevant is left. |
Closes #522, part 1 of 5: From note F3, unrefined parameter. Design: #522 (comment)
A refinement error whose Expected says nothing the verifier knows now gets a message note naming the cause, when the value is an unrefined parameter of the enclosing method. The CLI prints the note under the headline.
getMessageNotes()carries it to the extension, which is meant to show it in the hover (vscode-liquidjava#188).When the note is printed
All of these must hold, or there is no note:
UNKNOWN;Variablehas the declared refinementtrue.The note restates the declaration. It says nothing about callers and adds no fact to Found.
A2_04, before and after (only study task that changes)
Refinement Error: expected timeout >= 0 but could not prove it + From: timeout is a parameter of checkCimReachable(String, int) (line 94) with no refinement 103 | 104 | try (Socket socket = new Socket()) { 105 | socket.connect(new InetSocketAddress(host, port), timeout);A2_10, A1_38, A1_01, A1_56, A1_09, practice and practice2 are byte-identical to main. Each task still gives exactly one error, on its
reportedLine.Changes
LJDiagnostic.addMessageNote:getMessageNotes()returns these notes, andRefinementErrorputs them after its aliaswherelines. This is the hook the later From PRs use.FromNotes.unrefinedParameters, called whereVCCheckerbuilds the refinement error.TestFromNoteson the existing fixtureErrorUnknownArgument.java. It fails without the change.Conflicts
RefinementError). The overlap is only thegetMessageNotesoverride, and it is a trivial rebase.Tests:
mvn test, 729 run, 0 failures.🤖 Generated with Claude Code