Skip to content

ty does not respect ABC inheritance #704

@tonka3000

Description

@tonka3000

Summary

Currently ty seems not to respect ABC inheritance.

Example:

from abc import ABC
from typing import Any, Dict


class IAppStore(ABC):
    def __init__(self):
        pass

    def write(self, data: Dict[str, Any]): ...
    def read(self) -> Dict[str, Any]: ...

ty report error[invalid-return-type] <filename> Function always implicitly returns None, which is not assignable to return type dict[str, Any]on the linedef read(self) -> Dict[str, Any]: ...`.

An ABC class can not be instantiated, therefore this should not be marked as issue in my opinion because the API can only be None here.

Version

0.0.1-alpha.12 (f7446a6 2025-06-25)

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