SAP / ui5-typescript

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

`sap.ui.comp.filterbar.FilterItem.getControl` has return type `void` #363

Closed sap-sebelao closed 2 years ago

sap-sebelao commented 2 years ago

This is a really bad choice for a return type, as void can't even be cast to another type directly, it forces me to cast it via unknown first, like so: oFilterItem.getControl() as unknown as Control;.

akudev commented 2 years ago

Hi @sap-sebelao , thanks for reporting! A fix has been prepared and is in review internally (Change-Id: Ic2d0db623d41bfe020513e092f6346ecb67a814b).

akudev commented 2 years ago

Note that in general it's better to report an issue for the original control when the issue is in the JSDoc of the control and not in the UI5 type definition generator. A good hint that this is the case is when the official API documentation has the same issue. In this case it also says "void" here: https://ui5.sap.com/#/api/sap.ui.comp.filterbar.FilterItem%23methods/getControl

akudev commented 2 years ago

The fix was now submitted to master, will be in 1.105. Thanks again!