Skip to content

(🐞) Inconsistent reachability depending if module level or not #12409

Description

@KotlinIsland

Really strange behavior here, when this statement is on the module level it creates a silently unreachable branch, but when in a scope it doesn't create unreachable

importsysdeffoo() ->None:
assertsys.platform=="AMONGUS"a# error, reachable ❌cond: boolifcond:
assertsys.platform=="AMONGUS"a# error, reachable ❌assertsys.platform=="AMONGUS"a# no error, silent unreachable ✅

playground

Related #11438
Related #11361

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrongtopic-reachabilityDetecting unreachable code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions