Skip to content

Implementing Complex Generic Constraints #785

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

Activity

  1. added theissue type on Sep 30, 2025
  2. xuhuanzy commented on Sep 30, 2025

    @xuhuanzy
    MemberAuthor
  3. linked a pull request that will close this issueGenerics #786on Oct 1, 2025
  4. pinned this issue on Oct 5, 2025
  5. xuhuanzy commented on Oct 5, 2025

    @xuhuanzy
    MemberAuthor

    @CppCXY @clason @lewis6991 @taminomara
    I need more examples to determine if the system is stable. If possible, please try to merge #786 to test whether generic inference is functioning correctly.

  6. unpinned this issue on Oct 7, 2025
  7. pinned this issue on Oct 7, 2025
  8. unpinned this issue on Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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