Skip to content

bug(parsers/kotlin): object A { fun x() = 1 } on one line is never indexed #1600

Description

@Shashankss1205

Split out of #1595 (report 1 of 9) — filed by @rrodriguesNutrium, credit to them.

KOTLIN_QUERIES["classes"]'s (object_declaration (type_identifier) @name) pattern (kotlin.py:17) never matches a single-line object body:

object A { }                        // captured
object A {\n    fun x() = 1\n}      // captured
object A { fun x() = 1 }            // ZERO captures

The grammar misparses the one-line form into an infix_expression containing an object_literal and a lambda_literal, so the object_declaration node the query looks for is never produced. The sibling class_declaration pattern handles inline bodies fine.

Effect: singletons written on one line — a common Kotlin idiom — are silently missing from the graph.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status
    In progress
    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions