Closed
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