Skip to content

Stack overflow with __getattr__ #4632

Description

@correctmost

Describe the Bug

Pyrefly crashes when checking this fuzzed code:

from collections.abc import Awaitable

class C:
    def __getattr__(self: Awaitable):
        pass

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

Version info

Reproducible with 1.3.0-dev.2 and commit 19d136c

Sandbox Link

https://pyrefly.org/sandbox/?project=v2.w1tk4ihFHEGxCCo8EHnKGSU3paeWJJaUFEEzlBVCA3LyggR_TJ6zhqZeImZgKisEQAQUoO4CugYYC-mlwMIK6CC9mDxlYDmVqpBRUlJQbKWvD9OeX5Sun5qnn5KfXKyPokNfAZRuEssSM8FFIKpxCvngyC8GGktJLKpDIlEdXxyqg6IQqAJvtAAA

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions