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
{{ message }}
Repository navigation
JS: Prototype property assignment prevents property lookup from type reference #33013
varValidator=functionValidator(parser){this.flags="gim"};Validator.prototype.num=12/** * @param {Validator} state */varvalidateRegExpFlags=function(state){returnstate.flags};
Expected behavior: state.flags: string
Actual behavior:
Property 'flags' does not exist on type 'Validator'
Note that if you use a value like new Validator().flags, the property is resolved just fine. If you remove the prototype property assignment, the property also resolves.
Seems like an interaction of the contructor-functions-as-classes + stricter-jsdoc-type-references PR.
Activity
sandersn commentedon Aug 21, 2019
I reverted the strict-jsdoc-type-references and no change, so it's just constructor-functions-as-classes at fault.
sandersn commentedon Aug 22, 2019
In constructor-functions-as-classes, I forgot to update getTypeReferenceType. It should be a lot simpler now.