Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing optional modifier in conversion of eagerly resolved mapped types #2200

Closed
Gerrit0 opened this issue Mar 16, 2023 · 0 comments
Closed
Labels
bug Functionality does not match expectation

Comments

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 16, 2023

Search terms

missing optional, mapped types

Bug

When TypeDoc is given the following to document, it says the type of Test is { x: 1 | undefined } instead of { x?: 1 | undefined }

declare function buildObj<T>(x: T): {
    [K in keyof T]?: 1;
};

export const Test = buildObj({ x: 1 });

This happens with exactOptionalPropertyTypes both on and off.

Environment

  • Typedoc version: 0.23 + 0.24
  • TypeScript version: 4.9.5
  • Node.js version: 18
  • OS: Linux
@Gerrit0 Gerrit0 added the bug Functionality does not match expectation label Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
None yet
Development

No branches or pull requests

1 participant