Skip to content

Function invocation pins type of arguments too early #105

@grievejia

Description

@grievejia

Minimal repro:

def foo[T](a: T, b: T) -> T:
    ...

def test(x: int | None, y: int | None) -> int | None:
    if x is None:
        return foo(x, y)
    return None

Expected: No error
Actual: Argument int | None is not assignable to parameter b with type None in function foo [bad-argument-type]

Sub-issues

Metadata

Metadata

Assignees

Labels

googleissues from googlepytorchtypecheckingusabilityUsability & readiness issues identified with running Pyrefly on top OSS projects

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions