Skip to content

Detect when a NewType is assigned to type #10550

@erictraut

Description

@erictraut

The typing spec conformance tests were recently updated to test that a type checker emits an error when someone attempts to assign a type created with NewType to a value declared as type. I'm not sure why someone would ever attempt to do this, but it is technically disallowed by the spec.

UserId = NewType("UserId", int)
_: type = UserId

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions