Skip to content

Kotlin func_start misses extension functions with a generic receiver (Collection<X>.name, fun <T> List<T>.name) #3608

Closed

Description

@squid-protocol

Problem

Kotlin function extraction drops extension functions whose receiver type is generic:

source extracted
fun String.a(): Int { … } a ✓
public fun Collection<CodeBlock>.joinToCode(separator: CharSequence = ", "): CodeBlock { … } nothing
fun <T> List<T>.b(): Int { … } nothing
fun Map<String, Int>.c() = 1 nothing

Direct StructuralExtractor("kotlin", LANGUAGE_DEFINITIONS).splice(...) on each shape.

Impact

Fix direction

The receiver type in func_start needs to accept a bounded generic argument list (<…>, nesting ≤ 2) before the .name(, plus an optional type-parameter list after fun. Follow gitgalaxy/standards/how_to_add_a_language.md (ReDoS rules), add valid/invalid/pathological cases to tests/extraction/languages/test_kotlin.py, and verify with tree_sitter_accuracy_audit.py --lang kotlin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcore-engine

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions