SAP / ui5-typescript

Tooling to enable TypeScript support in SAPUI5/OpenUI5 projects
https://sap.github.io/ui5-typescript
Apache License 2.0
200 stars 28 forks source link

ManagedObject.prototype.getModel returns Model is wrong #380

Closed nlunets closed 1 year ago

nlunets commented 1 year ago

ManagedObject.prototype.getModel returns Model based on the jsdoc but in reality it will return Model | undefined

It would be nice to update the jsdoc to reflect that :)

akudev commented 1 year ago

Being fixed now, but please consider opening OpenUI5- or internal tickets for such clear cases in the future, so the code owners will take care (and learn about the importance of correct documentation while doing so).

nlunets commented 1 year ago

Ok, what do you prefer, internal tickets or openui5 ? :) I think i might find some more soon :)

akudev commented 1 year ago

I'm sure you will. We have done a round of automated searching and fixing recently, but only considered the return value comment text. Even this resulted in ... was it ~~100? ... fixes. Code analysis would likely bring up more hits and still miss many.

Internal tickets have lower dispatching overhead (would be anyway opened for GitHub tickets), so please create those.

akudev commented 1 year ago

Fixed via https://github.com/SAP/openui5/commit/b8ac5506780690ebc7bc18841797128b648a584b

akudev commented 1 year ago

@nlunets Actually, for very clear cases you could propose the fix in Gerrit as well. A code review is done more easily than a change.