Skip to content

Check the type of self when accessing a method via instance #126

Closed
@JukkaL

Description

@JukkaL

When creating a bound method object in statically typed code, the type checker should complain if the type of the method self argument is not compatible with the receiver. For example, this should be an error:

class A:
    def f(o: int) -> None: pass
A().f    # receiver is A, self is int: not compatible

The issue #16 is related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions