Skip to content

isConst flag not set for constants #1866

@niekvb

Description

@niekvb

Search terms

isConst, variables, constants, flags

Expected Behavior

Expected isConst flag to be set when DeclarationReflection.kind is ReflectionKind.Variable.

Actual Behavior

The isConst is not set when the reflected item is a const.

Steps to reproduce the bug

export const TEST_CONST: string = "";

Console.log output of the DeclarationReflection:

{
  id: 1198,
  name: 'TEST_CONST',
  kind: 32,
  kindString: 'Variable',
  flags: {},
  comment: { ... },
  decorates: undefined,
  decorators: undefined,
  children: undefined,
  groups: undefined,
  categories: undefined,
  sources: [ { ... } ],
  typeParameter: undefined,
  type: { type: 'intrinsic', name: 'string' },
  signatures: undefined,
  indexSignature: undefined,
  defaultValue: '""',
  overwrites: undefined,
  inheritedFrom: undefined,
  implementationOf: undefined,
  extendedTypes: undefined,
  extendedBy: undefined,
  implementedTypes: undefined,
  implementedBy: undefined,
  parentId: 1192
}

Environment

  • Typedoc version: 0.22.11
  • TypeScript version: 4.5.5
  • Node.js version: 14.15.4
  • OS: WSL Ubuntu 20.04 on Windows 10 Pro (build 19043.1415)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions