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
functioninferType(value: string){constasBoolean: boolean|null=null;constasDate: Date|null=null;constasDouble: number|null=null;constasLong: number|null=null;constasURL: URL|null=null;return{value_as_string: value,value_as_boolean: asBoolean,value_as_date: asDate,value_as_double: asDouble,value_as_long: asLong,value_as_url: asURL,};}typeEventMetaData={key: string;value_as_string: string;value_as_boolean: boolean|null;value_as_date: string|null;value_as_long: number|null;value_as_double: number|null;};functionconvert(key: string,value: string): EventMetaData{consttypes=inferType(value);return{key: key,
...types// Expect error here because `value_as_url` is not allowed};}
Would expect the following error (or something like that):
Type '{ value_as_url: URL; value_as_string: string; value_as_boolean: null; value_as_date: null; value_as_double: null; value_as_long: null; key: string; }' is not assignable to type 'EventMetaData'.
Object literal may only specify known properties, and 'value_as_url' does not exist in type 'EventMetaData'.(2322)
Bug Report
Would expect the following error (or something like that):
🔎 Search Terms
object spread extra properties expected error
🕗 Version & Regression Information
Using TypeScript 4.1.5
⏯ Playground Link
No error playground
Expected error
The text was updated successfully, but these errors were encountered: