Repository navigation
fix(kotlin): extract extension functions with a generic or nullable receiver (#3608) - #3629
Merged
Merged
Conversation
…eceiver (#3608) `func_start` and `args` only accepted a plain `[\w.]+` receiver, so `fun Collection<CodeBlock>.joinToCode(...)`, `fun <T> List<T>.b()` and `fun String?.d()` were not extracted at all. Both now share a `_RECEIVER` fragment that takes a bounded, one-level-nested generic argument list and an optional `?`. kotlinpoet vs tree-sitter function_declaration: recall 96.4% -> 99.0% (+56 functions, 0 new false positives). Golden masters unchanged (the crucible's Kotlin samples have no generic receivers). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YAtpBfGGyBGGovitSVaM5Q
Contributor
follow-up) #3627 stopped the Packed Payload Guard relegating import manifests, so the crucible's three.js barrel `threejs/Nodes.js` (166 lines, 139 of them `export ... from`) is scanned again: files_scanned 18 -> 19. It declares no functions or classes, so every other count is unchanged. main's tree-sitter-accuracy-audit has been red on this since #3627 merged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YAtpBfGGyBGGovitSVaM5Q
Owner
Author
|
Bisect:
Cause: #3627 stopped the Packed Payload Guard from relegating import manifests. The crucible's three.js barrel Fix: the JavaScript baseline is regenerated in 6ab22bb on this PR. main's check goes green again once this PR merges. Generated by Claude Code |
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.
Closes #3608.
Problem
Kotlin
func_startandargsonly accepted a plain[\w.]+receiver. These were extracted as nothing:fun Collection<CodeBlock>.joinToCode(...)fun <T> List<T>.b()fun Map<String, Int>.c() = 1fun String?.d()Fix
func_startandargsnow share one_RECEIVERfragment. It accepts:Map<K, List<V>>), with bounded repetition so an unclosed<stays linear;?.Verification
.ktfile, against tree-sitterfunction_declaration: recall went from 96.4% to 99.0% (2034 → 2090 of 2111). That is +56 functions and 0 new false positives: every newly extracted name is a tree-sitter function in the same file.tests/extraction/languages/test_kotlin.py. The kotlin tests pass (150).crucible_check.py --update --yesreports no drift in either fixture; the crucible's Kotlin samples have no generic receivers.tree_sitter_accuracy_audit --lang kotlin --ci: OK.import_graph_accuracy --ci: OK. Kotlin stays at 100/95.2. The remaining misses are extension properties (val KmClass.isObject), which are not functions and are out of scope here.kotlin.pyhas none. The only mypy findings locally wereyamlstubs andre.suboverload issues in untouched files, caused by this environment.🤖 Generated with Claude Code
https://claude.ai/code/session_01YAtpBfGGyBGGovitSVaM5Q
Generated by Claude Code