Skip to content

Conformance: Missing type alias validation #2451

Closed

Description

@migeed-z

Describe the Bug

All of the following validation is missing:

BadTypeAlias1 = eval("".join(map(chr, [105, 110, 116])))
BadTypeAlias6 = (lambda: int)()
BadTypeAlias7 = [int][0]
BadTypeAlias8 = int if 1 < 3 else str
BadTypeAlias12 = list or set

def bad_type_aliases(
    p1: BadTypeAlias1,  # should error: eval result is not a valid type
    p6: BadTypeAlias6,  # should error: lambda call is not a valid type
    p7: BadTypeAlias7,  # should error: list subscript is not a valid type
    p8: BadTypeAlias8,  # should error: conditional expr is not a valid type
    p12: BadTypeAlias12,  # should error: 'or' expr is not a valid type
):
    pass

Sandbox Link

https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeSIAQqpgCqnEwCCUEqcAjAAQC8XMAN1RQAFAB0QEwgCtcEdCIC2qYiIDGACwBOAGi4BtDgAYArHo7HzHAGwBdAJSOx6anQbNW7a7y4ioqRWxMVEQueQAXexF7Z1d6RhY2OAB2H30I230jW1iaeI8kgA4fCLCwLm4AHi4AZn4oOBguOHCtXLcEz04AJh9WFq5cLWaYcOdnTBhy7BoAfXD3WeEk%2BHF0Lg2uYg5QuPdE9g49LgBiZo1cAFcoTH4tLSHQwWEuLXhr8LC4LnRcT9QuEJWLcFoxnJsttZdnl9l1rMcznALtdbjB7o8uP5AsEuGphFAvj8-lwAUCICD3ODNsRktCOgV2MkEecrjc7g8tKF%2Bp84JdsHA1FoIMRPhBvr9-oDlhSwetqYU6fkDnBCsykazUejObjcFgIOEILqXjB8MRhmKiZKyTKYFSNttuorYUkON01ci2WiOaEAORDH38U3m8XE0nSrig23oeyIO1bdgIHQgS4GhokciIEBnACqqf1pC4YEu6DUBt1cHGWCmhaGynCs3Ql0CaJE%2BFCEXsXAAtAA%2BZqtWNyjZvcKXLTrMASAByTewaNCwHwAF8JM4QEmyG8wFBSIRwrhFFAKGcAAqkLc75oYHAEHXoSAAczHqDL6EIzjOAGUYE0NOFwsQcCIAA9MBm5TDuhBDA%2BwEwOgwGYLgahwMBai6o%2Bz6vsBNbDKgQjQKg2CwHeGFaC%2BhrrLgIoUXA77oGQ4QXOgXYCGicAUT4Eg1IQrqrugIBLkmqClhArEAGLQDAFBoFgeBEGQAlAA

(Only applicable for extension issues) IDE Information

No response

Activity

  1. asukaminato0721 commented on Apr 18, 2026

    @asukaminato0721
    Collaborator

    claim

  2. rchen152 commented on May 19, 2026

    @rchen152
    Contributor

    This seems to be fixed; all of the should error lines in the sandbox link now error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions