Skip to content

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnintended behavior or logic failure in the enginecore-engineModifications to the central physics and parsing engine

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions