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
/** * @typedef {Array} A * @property {string} a *//** * @type {A} */vara;a.a;// Property 'a' does not exist on type 'any[]'./** * @typedef {any[]} B * @property {string} b *//** * @type {B} */varb;b.b;// Property 'b' does not exist on type 'any[]'./** * @typedef {{}} C * @property {string} c *//** * @type {C} */varc;c.c;// Property 'c' does not exist on type '{}'./** * @typedef {Object} O * @property {string} o *//** * @type {O} */varo;o.o;// string
Expected behavior:
Other types to behave similarly? I thought non-alias typedefs would act like
type__X={};// from @typedef type expressioninterfaceXextends__X{x: string// from @property}
Either way of making it not work for object or allowing it to work for other types seems reasonable.
Actual behavior:Object is treated as a special type that doesn't behave like other types. See comments in example for errors when using other types.
Playground Link: it is JSDoc, can't.
Related Issues: n/a
The text was updated successfully, but these errors were encountered:
TypeScript Version: 3.4.0-dev.201xxxxx
Search Terms: typedef jsdoc widen extend property
Code
Expected behavior:
Other types to behave similarly? I thought non-alias typedefs would act like
Either way of making it not work for object or allowing it to work for other types seems reasonable.
Actual behavior:
Object
is treated as a special type that doesn't behave like other types. See comments in example for errors when using other types.Playground Link: it is JSDoc, can't.
Related Issues: n/a
The text was updated successfully, but these errors were encountered: