Skip to content

Attempt to more-frequently use local aliases when printing out types #34778

Open
@DanielRosenwasser

Description

@DanielRosenwasser

When a user imports a type alias like

// ./a.ts
export type Foo = number | string | symbol;

We should try to print out Foo in error messages like in

// ./b.ts
import { Foo } from "./a.js"

let x: Foo = true;

and in declaration emit like in

// ./c.ts
import { Foo } from "./a.js"

function f(x: Foo) {
  return x;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: Type DisplayBugs relating to showing types in Quick Info/Tooltips, Signature Help, or Completion InfoNeeds ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions