You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@RyanCavanaugh @Dj-jom2x setValue("a", { b: "" }); is not a legal call.
It would get error as expect
error TS2345: Argument of type '{ b: string; }' is not assignable to parameter of type '{ a: string; }'.
Object literal may only specify known properties, and 'b' does not exist in type '{ a: string; }'.
What I try to achieve is to let key and value match.
The issue is:
Type inference works well on function call params checking
TypeScript Version: 3.5.3
Search Terms: Type inference function
Code
Expected behavior:
Compile succ
Actual behavior:
test.ts:9:27 - error TS2339: Property 'a' does not exist on type 'ValueType[T]'.
9 console.log(value.a);
Playground Link:
Related Issues:
#31904
The text was updated successfully, but these errors were encountered: