Skip to content

[1.16 regression] assigning a lambda to subclass w/ generics #19165

@Redoubts

Description

@Redoubts

Bug Report

Consider the following:

https://mypy-play.net/?mypy=latest&python=3.12&gist=29ddead67873ff6c1f1bf36de8726bd7

This works without error in 1.15 mypy. But in the new 1.16 version, one would see Incompatible return value type (got "int", expected "T") on converter2

Your Environment

  • Mypy version used: 1.16
  • Mypy command-line flags: (defaults)
  • Mypy configuration options from mypy.ini (and other config files): n/a
  • Python version used: 3.11 & 3.12

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