Skip to content

[panic] Callable type annotations cannot be overloaded #3278

@NorthLake

Description

@NorthLake

Summary

I use ty's LSP through the RyeCharm plugin in Pycharm. I don't have a config file set. These are the settings I used in RyeCharm:

Image

Reproduction example:

def apply_formatting(string: str, case_style: Literal["upper", "lower", "title"]) -> str:
    case_map = {
        "upper": str.upper,
        "lower": str.lower,
        "title": str.title,
    }
    return case_map.get(case_style, lambda x: x)(string)

Error output:

Panicked at crates\ty_python_semantic\src\types\infer\builder.rs:6455:17 when checking `c:\[...].py`: ``Callable` type annotations cannot be overloaded`

info: This indicates a bug in ty.
info: If you could open an issue at https://github.com/astral-sh/ty/issues/new?title=%5Bpanic%5D, we'd be very appreciative!
info: Platform: windows x86_64 info: Version: 0.0.30 (12e86b58b 2026-04-14)
info: Args: ["C:\\[...]\\ty.exe", "server"]
info: Backtrace:
0:
[1-31]:
32:
33: BaseThreadInitThunk
34: RtlUserThreadStart

info: query stacktrace:
0: infer_scope_types_impl(Id(1b86))
at crates\ty_python_semantic\src\types\infer.rs:263
1: check_file_impl(Id(149d))
at crates\ty_project\src\lib.rs:616

Version

ty 0.0.30 (12e86b5 2026-04-14)

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfatala fatal error (panic or crash)

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions