-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
Effort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Help WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
class X<T>
{
f(t: T) { return { a: t }; }
}
var x: X<number>;
var t1 = x.f(5);
t1.a = 5; // Should not error: t1 should have type {a: number}, instead has type {a: T}
var x2: X<void>;
var t2a = x.f(void 0); // It works but void 0 it's unnecessary
var t2b = x.f(); // SUGGESTION: ignore syntax check of last argument if it's type is void
t2b.a = void 0; // Should not error: t2 should have type {a: void}, instead has type {a: T}
test case: tests/cases/compiler/genericObjectLitReturnType.ts
maybe the solution is the same for #3356
garkin, myrdd, j1i-ian, michaeljota and aikoven
Metadata
Metadata
Assignees
Labels
Effort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Help WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript