-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
CommittedThe team has roadmapped this issueThe team has roadmapped this issueEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".FixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
I have some code like this, except there are about a dozen types instead of just three:
interface Foo {
kind: "foo";
name: string;
}
interface Bar {
kind: "bar";
name: string;
}
interface Qua {
kind: "qua";
length: string;
}
type FBQ = Foo | Bar | Qua;
let x: FBQ = <any>undefined;
console.log(x.name);
The error reported is
a.ts(16,15): error TS2339: Property 'name' does not exist on type 'FBQ'.
This is inactionable on a union type, especially when its consituents are hidden behind an alias. We should show something like
a.ts(16,15): error TS2339: Property 'name' does not exist on type 'FBQ'.
Property 'name' does not exist on type 'Qua'
yahiko00, tinganho, vashchukmaksim and sandgupta23
Metadata
Metadata
Assignees
Labels
CommittedThe team has roadmapped this issueThe team has roadmapped this issueEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".FixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript