KotlinIsland / KotlinIsland/basedmypy

Support `Overload` types to properly handle overload signatures and implementations

Open
#245 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Python
Stars
202
Forks
6
PR merge metrics
No merged PRs in 30d

Description

@overload
def foo(a: int) -> str: ...
@overload
def foo(a: str) -> int: ...
def foo(a: Overload) -> Overload:
    reveal_type(a)  # a is part of an overloaded type, it could be `int` or `str` (not a union)
    return a  # error, incorrect overloaded types:
        #  when expecting str, found int
        #  when expecting int, found str

The actual Overload type sounds fairly useless, it's just in this egg for demonstration purposes.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start with the overload-signature example in the issue and locate the relevant type-checking behavior; done means Overload values are handled as overloaded types rather than unions, with the shown reveal and compatibility errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.