Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mypy still segfaults on callable protocol with Self #17743

Open
bodograumann opened this issue Sep 6, 2024 · 1 comment
Open

mypy still segfaults on callable protocol with Self #17743

bodograumann opened this issue Sep 6, 2024 · 1 comment
Labels

Comments

@bodograumann
Copy link

Bug Report

mypy crashes with a Segmentation Fault when a Protocol with def __call__(self: Self) is used.

To Reproduce

Like already reported in #17314 and #16629, the following code demonstrates the issue:

from typing import Protocol, Self

class Printer(Protocol):
    def __call__(self: Self): ...

class Version:
    def __init__(self, printer: Printer): ...

Version(printer=print)

https://gist.github.com/mypy-play/cd3e93a1930402369f81735d13427eae

Expected Behavior

mypy should maybe print out some errors, but definitely not cause a Segmentation Fault.

Actual Behavior

segmentation fault (core dumped)  mypy segfault-mypy.py --show-traceback

Your Environment

  • Mypy version used: 1.11.2
  • Mypy command-line flags: None or --show-traceback
  • Mypy configuration options from mypy.ini (and other config files): -
  • Python version used: 3.12.5
@bodograumann bodograumann added the bug mypy got something wrong label Sep 6, 2024
@sobolevn
Copy link
Member

sobolevn commented Sep 7, 2024

I cannot reproduce locally with non-compiled build on main:

» mypy ex.py --show-traceback --show-error-codes --warn-unreachable --python-version=3.13
Success: no issues found in 1 source file

Looks like this is a mypyc issue. Or it was fixed on main 🤔

@sobolevn sobolevn added topic-mypyc mypyc bugs crash and removed bug mypy got something wrong labels Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants