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

Inconsistent type hover information #39262

Open
tjjfvi opened this issue Jun 25, 2020 · 0 comments
Open

Inconsistent type hover information #39262

tjjfvi opened this issue Jun 25, 2020 · 0 comments
Labels
Bug A bug in TypeScript Domain: Quick Info e.g. hover text, tool-tips, and tooltips.
Milestone

Comments

@tjjfvi
Copy link
Contributor

tjjfvi commented Jun 25, 2020

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

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Jun 25, 2020
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Jun 25, 2020
@RyanCavanaugh RyanCavanaugh added the Domain: Quick Info e.g. hover text, tool-tips, and tooltips. label Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Quick Info e.g. hover text, tool-tips, and tooltips.
Projects
None yet
Development

No branches or pull requests

2 participants