Skip to content

Inconsistent type hover information #39262

Open
@tjjfvi

Description

@tjjfvi

TypeScript Version: 3.9.2, Nightly

Search Terms: inconsistent type hover

Expected behavior: When the variable x is of type T, the type shown in the hover information is the same for both.

Actual behavior: The variable x is of type T, but the type shown for x is different than the type shown for T.

Related Issues: N/A

Code

// Hover `T` shows { a: 5 }
type T = Pick<{ a: 5, b: "string" }, "a">

// Hover `T` shows { a: 5 }
// Hover `x` shows Pick<{ a: 5, b: "string" }, "a">
declare const x: T;
Output
"use strict";
Compiler Options
{
  "compilerOptions": {
    "noImplicitAny": true,
    "strictNullChecks": true,
    "strictFunctionTypes": true,
    "strictPropertyInitialization": true,
    "strictBindCallApply": true,
    "noImplicitThis": true,
    "noImplicitReturns": true,
    "useDefineForClassFields": false,
    "alwaysStrict": true,
    "allowUnreachableCode": false,
    "allowUnusedLabels": false,
    "downlevelIteration": false,
    "noEmitHelpers": false,
    "noLib": false,
    "noStrictGenericChecks": false,
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "esModuleInterop": true,
    "preserveConstEnums": false,
    "removeComments": false,
    "skipLibCheck": false,
    "checkJs": false,
    "allowJs": false,
    "declaration": true,
    "experimentalDecorators": false,
    "emitDecoratorMetadata": false,
    "target": "ES2017",
    "module": "ESNext"
  }
}

Playground Link: Provided

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Quick Infoe.g. hover text, tool-tips, and tooltips.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions