Describe the Bug
After upgrading Pyrefly in scipy-stubs to 0.64.0, Pyrefly reported a new false positive bad-specialization error. At first I thought it might be the same issue as #3329, but after more investigation, I think it's a separate issue.
Here's the repro.zip:
from typing import Callable, Protocol, overload
class Base: ...
class HasCall(Protocol):
@overload
def __call__[T: Base](self, arg: T) -> T: ...
@overload
def __call__(self, arg: float) -> float: ...
def takes(f: Callable[[float], float]) -> None: ...
def repro(p: HasCall):
takes(p) # E: bad-specialization
This is still on issue on main.
Blocked scipy-stubs PR: scipy/scipy-stubs#1593
Sandbox Link
https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeS4ATrgLYAEALqcROgOZ0Q3G6UN0BhVFCipssADR0ACtQa4AxrihTcANxiUouVJgA66AwtFw4dAEKo4MRHUL2DRk2YASVoSIAUs3PKVQASkQDOlC6AAF1TW1dELDMGDA6AH1khWEoVIBtABVbS2sAXU9rKDApVEo2WxyAugBaAD46PLsHdDCIqK0dfQ74xJS0jNSSmDKKqtswGIY6proZnQZbe0JHLEGGVABreE8wWw9RcRgsrKXUBkKpS%2Bv55oA5XHQbNvXDTaTKGGJqT2ItjccGOQTioW2ezgALqdAAxHQAKK2bC6epwYgwBQQYQQABeVwgLwMIAkIDIPxmpEI8hoUAoAFd0ExMZh6gkwPVsDAABaoNREyh0AC8dD0IAUPKxO3qGDZrDAmnqPwYDMo6Fl6FI4pAAF8yagFAwIBoAGLQGAUNBYPBEMh6oA
(Only applicable for extension issues) IDE Information
No response
Describe the Bug
After upgrading Pyrefly in scipy-stubs to 0.64.0, Pyrefly reported a new false positive
bad-specializationerror. At first I thought it might be the same issue as #3329, but after more investigation, I think it's a separate issue.Here's the repro.zip:
This is still on issue on main.
Blocked scipy-stubs PR: scipy/scipy-stubs#1593
Sandbox Link
https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeS4ATrgLYAEALqcROgOZ0Q3G6UN0BhVFCipssADR0ACtQa4AxrihTcANxiUouVJgA66AwtFw4dAEKo4MRHUL2DRk2YASVoSIAUs3PKVQASkQDOlC6AAF1TW1dELDMGDA6AH1khWEoVIBtABVbS2sAXU9rKDApVEo2WxyAugBaAD46PLsHdDCIqK0dfQ74xJS0jNSSmDKKqtswGIY6proZnQZbe0JHLEGGVABreE8wWw9RcRgsrKXUBkKpS%2Bv55oA5XHQbNvXDTaTKGGJqT2ItjccGOQTioW2ezgALqdAAxHQAKK2bC6epwYgwBQQYQQABeVwgLwMIAkIDIPxmpEI8hoUAoAFd0ExMZh6gkwPVsDAABaoNREyh0AC8dD0IAUPKxO3qGDZrDAmnqPwYDMo6Fl6FI4pAAF8yagFAwIBoAGLQGAUNBYPBEMh6oA
(Only applicable for extension issues) IDE Information
No response