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

Regression: some types are misplaced or not displayed #1529

Closed
marcofugaro opened this issue Mar 8, 2021 · 3 comments
Closed

Regression: some types are misplaced or not displayed #1529

marcofugaro opened this issue Mar 8, 2021 · 3 comments
Labels
bug Functionality does not match expectation

Comments

@marcofugaro
Copy link

Search terms

types misplaced not displayed

Actual Behavior

I have this code:

export const BODY_TYPES = {
  DYNAMIC: 1,
  STATIC: 2,
  KINEMATIC: 4,
} as const

export type BodyType = typeof BODY_TYPES[keyof typeof BODY_TYPES]

export class Body  {
   /**
   * One of: `Body.DYNAMIC`, `Body.STATIC` and `Body.KINEMATIC`.
   */
  type: BodyType

  // ... 
  constructor(
    options: {
      /**
       * One of: `Body.DYNAMIC`, `Body.STATIC` and `Body.KINEMATIC`.
       */
      type?: BodyType
      
      // ...
    } = {}
  ) {

}

And the options.type is not showing the BodyType, but instead its literal value (happens from v0.20.6, possibly related to #1528).

image
image

While the class property, is showing totally a different type!! (happens from v0.20.13)

image

For context, the type RayMode is in totally another part of the application and corresponds to this:

export const RAY_MODES = {
  CLOSEST: 1,
  ANY: 2,
  ALL: 4,
} as const


export type RayMode = typeof RAY_MODES[keyof typeof RAY_MODES]

Expected Behavior

This should be the correct behaviour as it is with v0.20.5:

image

image

Steps to reproduce the bug

I can link the repo where this happens if needed

Environment

  • Typedoc version: v0.20.6 and up
@marcofugaro marcofugaro added the bug Functionality does not match expectation label Mar 8, 2021
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 8, 2021

What TypeScript version are you using?

@marcofugaro
Copy link
Author

4.0.5, but I'll try upgrading it and see if the issue persists!

@marcofugaro
Copy link
Author

Updating typescript completely solves this issue, thanks!

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

2 participants