Skip to content

Implementing Complex Generic Constraints #785

@xuhuanzy

Description

@xuhuanzy

Implementation referenced from the generic inference syntax of TypeScript. #786

  1. Added annotation system keywords: keyof, in, extends, infer, and, or.
  2. Added more tests to stabilize the type inference system.

Internal changes:

  1. Variable arguments (...) should be deduced as tuples. (Partially completed)

Grammar Reference:
The syntax is highly similar to Typescript, with the difference being that

  1. : -> and
  2. ? -> or
  3. = ->

Reference file: #786 crates/emmylua_code_analysis/src/compilation/test/generic_test.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions