Skip to content

Missing-attribute FP on super() calls to abstract methods with bodies #2731

@grievejia

Description

@grievejia

Describe the Bug

Minimal repro:

from abc import ABC, abstractmethod

class BaseCLI(ABC):
    @abstractmethod
    def run(self) -> int:
        return 0


class AdHocCLI(BaseCLI):
    def run(self) -> int:
        super().run()  # FP: no implementation via super()
        return 42

No other type checker choose to error on this pattern. The body may have legit default logic even when marked as abstract.

Sandbox Link

https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeS4ATrgLYAEq2AxnRDcbpQC50CCAQgGEANA2xwulVEy40YXABa5MAHXRqmUVHDh1%2B2mIIAyASQAUAwQEpEauvboABRhKky5i5XYeYYYOpQAruhmcDBQYFZ0ALQAfKzoXLboDqkB8oGUKQAMannomtq6vJgAErhMxub6YVU23va%2B-kEhYRFRcQlJDWlwgcQwlGZWhC3D9gDEdABiAAqIdOi4rOywcomoXBC4KQBuEKh0fQNDVj2plBlZdAAsAEwgwiCBW1BwJOSIIFMAqq8QXFIdDAwRk23QcHyTWBnBomwA%2BuhAjRsIMzPgFhBEh14q5khcrikwCoQAA5ZGoygLYD4AC%2BJLUjxAZEuYCgpEIXFoUAoU1mpFZ7KOGBwBDoTB2kAA5plNuDCGopgBlGAwOgKLhcYhwRAAel1LL87MInClupg6F1mAqcF1EvQ0tlWx2uphlAYu1Q0EYsHFkogMqkzpSuGIwfeajInnQ0V2gzg4LoAF46CSAMyEACMdwZ6BAtKe0i2cem0BgFDQWDwRDI%2BaAA

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Labels

typecheckingusabilityUsability & readiness issues identified with running Pyrefly on top OSS projects

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions