Skip to content

Stubs: extension properties on a class whose stub name is taken in its module are dropped (Icons.Default.Add) #68

Closed

Description

@b-re-w

The kotlin-stubs artifact (run 37097934282, develop 31c092f) has, in androidx/compose/material/icons/__init__.pyi:

# Kotlin property: androidx.compose.material.icons.filled.Add is not stubbed: Filled has no stub class (its name is taken in its module)

Icons.Default.Add works at run time (MaterialIconsRenderTest.iconsDefaultAddDrawsFromPythonExactlyAsFromKotlin), but the stub has no Add, so IDE completion fails and mypy rejects Icons.Default.Add (pythonx-compose DefaultIcons.Add). Icons.Filled is a nested class of the Icons object; its name collides in the module (likely with the filled package or the folded class module from the case-unique layout).

Completion: a stub test where an extension property's receiver is a nested class of an object whose name collides in its module still produces a typed attribute (Add: ImageVector reachable as Icons.Filled.Add / Icons.Default.Add); regenerated Compose stubs pass tools/stubs/check-stubs.sh with a consumer line Icons.Default.Add.

Activity

  1. b-re-w commented on Oct 3, 2026

    @b-re-w
    MemberAuthor

    Landed in develop via #80.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions