Skip to content

Stack overflow in call_infer_with_callee_range #4437

Description

@correctmost

Describe the Bug

Pyrefly crashes when checking this fuzzed code:

from collections.abc import Callable

def fn[T](c: Callable[[T], None]) -> T:
    pass

class C:
    @fn
    def __new__(cls):
        pass

C()
thread '<unknown>' (238807) has overflowed its stack
fatal runtime error: stack overflow, aborting

Version info

Tested with commit c63e4ac

Sandbox Link

https://pyrefly.org/sandbox/?project=v2.w1tkEihF4Ak2LzokViPZCi4RDeQDy0RgvMeCU0AISojD8qEzVNQhDSnzABNBajkwJybnFCOnRZhOZ1AKwAx5ZYUAiIAC1BNApwOjLL0UWLIBXa8Xk6cMLNRSFTJKSgqKrfT1Ydrzi9L1U_P0U_KTi_VRdOgrgBJZYlliJthDqMYp5INTSjHQWEqiXB0S4-r4IlwdFN9AFXjjEAA

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions