Skip to content

Implement argument type expansion for overload call evaluation #468

@AA-Turner

Description

@AA-Turner

Summary

I don't believe this is a duplicate, apologies if otherwise.

from typing import Any
class Spam:
    def __getitem__(self, item: int | slice) -> Any:
        return (1, 'spam', None)[item]

ty reports: `Method `__getitem__` of type `Overload[(key: SupportsIndex, /) -> Unknown, (key: slice[Any, Any, Any], /) -> tuple[Unknown, ...]]` is not callable on object of type `tuple[Literal[1], Literal["spam"], None]` (call-non-callable) [Ln 4, Col 16]`

A

https://play.ty.dev/13c25386-6806-4686-880c-7891a3fb9044

Version

play.ty.dev reports 0.0.0, but locally ty 0.0.1-alpha.5 (3b726d87a 2025-05-17)

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcallsIssues relating to call-signature checking and diagnosticsoverloads

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions