Skip to content

Class definition bindings should not be visible in nested scopes #264

Open
@grievejia

Description

@grievejia

Describe the Bug

Minimal repro:

x = 1

class A:
    x = 4
    [reveal_type(x) for a in range(1)]

    class B:
        reveal_type(x)

Expected: Both reveals produce Literal[2]
Actual: Both reveals produceLiteral[1]

Sandbox Link

https://pyrefly.org/sandbox/?code=B4AgvCCMBQ0MYBsCGBnFICCAuaI8lAgBZd8BtAJwFMA3KpBAfQBcBPAByoApgBKEAGYB7CiCQgAlgDsQFJFIDm3SLwC6sfCESp0AIRybN1OgxYdufaEA

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions