已关闭
[es2panda] No CTE for field overriding with different types #9209
lirismankarina创建于  2月19日关闭于  6月24日
lirismankarina
lirismankarina
2月19日 创建

感谢对OpenHarmony社区的支持与关注,欢迎反馈缺陷。

发生了什么问题?

Warning->CTE: cannot override because overriding type is not compatible with the base type.

example of incorrect code:

class A {
fee: int = 5
foo(): void { console.log("aaa")}
}

class B extends A {
fee: number = 10
faa(): void {console.log("bbb")}
}

Warning W52491: fee in B cannot override fee in A because overriding type is not compatible with the base type. [tmpy22e3_4d.ets:7:5]

Need to set CTE for internal sources first (use DPANDA_STRICT_MODE=true), then clean up code in subsystems in the next pr

期望行为是什么?

如何复现该缺陷

其他补充信息

版本或分支信息


[x] master

[ ] Release 6.1

[ ] Release 6.0

[ ] Release 5.1.0

[ ] Release 5.0.3

[ ] Release 4.1

[ ] Other

likedislike
lirismankarinalirismankarina
2月19日 添加了label:bug
openharmony_ci
openharmony_ci成员
2月19日 评论:

感谢提交Issue!关于Issue的交互操作,请访问OpenHarmony社区支持命令清单。如果有问题,请联系 [@xucheng46](https://gitcode.com/xucheng46) [@gavin1012_hw](https://gitcode.com/gavin1012_hw) [@trubachevilya](https://gitcode.com/trubachevilya) [@vpukhov](https://gitcode.com/vpukhov) [@chernykhsergey](https://gitcode.com/chernykhsergey) [@zhuoli](https://gitcode.com/zhuoli) 。如果需要调整订阅PR、Issue的变更状态,请访问链接。


Thanks for submitting the issue. For more commands, please visit OpenHarmony Command List. If you have any questions, please refer to committer gitcode for help. If you need to change the subscription of a Pull Request or Issue, please visit the link.

likedislike
openharmony_ciopenharmony_ci成员
2月19日 添加了label:waiting_for_assign
sergeybogdanovsergeybogdanov
3月12日 关联了pull request:[WIP]Mark field overriding message as CTE
sergeybogdanov
sergeybogdanov
3月12日 评论:

Current Status

Experimental PR is created. The PR convert the warning on field overriding to CTE. With these changes ninja tests does not show any errors. In OHOS CI the only one job is failed. In the log of failed job only one error message has been generated.

Right now looking for details of the detected overriding.

likedislike
sergeybogdanovsergeybogdanov
3月13日 关联了pull request:Remove overriding fields with different types
sergeybogdanov
sergeybogdanov
3月13日 评论:

Current Status

Right now working on the field overriding case in the class PhotoEditorExtensionAbility (file: @ohos.app.ability.PhotoEditorExtensionAbility.ets from the repository "ability_ability_runtime"). Rough solution is committed and being tested with OHOS CI.

likedislike
sergeybogdanovsergeybogdanov
3月16日 关联了pull request:[WIP]Rename necessary fields to avoid field overriding
sergeybogdanov
sergeybogdanov
3月17日 评论:

The following auxilary issues have been created to help with finding the problems in the codebase:

Issue to mark field overriding as CTE.
https://gitcode.com/openharmony/arkcompiler_ets_frontend/issues/9576

Issue using white list to spot field overriding cases:
https://gitcode.com/openharmony/arkcompiler_ets_frontend/issues/9698

likedislike
lirismankarinalirismankarina
3月17日 关联了pull request:Add -k0 argument for ohos run
lirismankarinalirismankarina
3月18日 关联了pull request:Test changes
sergeybogdanov
sergeybogdanov
3月18日 评论:

Current Status

New strategy to commit the changes would be to commit in small bunches. For that the warning is supplied with "exclusion list". The exclusion list references to files where the warning should become CTE. And among these files the case of field overriding is fixed.
In the current step this strategy will be applied on two repositories: ability_ability_runtime and ability_form_fwk.

likedislike
sergeybogdanov
sergeybogdanov
3月18日 评论:

New technical issue is created to merge changes in ability_ability_runtime and ability_form_fwk repositories.

https://gitcode.com/openharmony/arkcompiler_ets_frontend/issues/9585

Part 1 -> Merged

likedislike
sergeybogdanov
sergeybogdanov
3月19日 评论:

One more technical issue is created. The goal of this issue is make necessary changes in the distributeddatamgr_udmf repository.

https://gitcode.com/openharmony/arkcompiler_ets_frontend/issues/9591

Combined with the next issue to be Part 2

likedislike
sergeybogdanov
sergeybogdanov
3月20日 评论:

Technical issue to make necessary changes in the arkui_ace_engine repository is created.

https://gitcode.com/openharmony/arkcompiler_ets_frontend/issues/9602

Part 2

likedislike
sergeybogdanov
sergeybogdanov
3月24日 评论:

Current Status

The repositories distributeddatamgr_udmf and arkui_ace_engine are fixed and on the way to be merged.

Currently looking for other problems in other repositories with field overriding.

likedislike
sergeybogdanov
sergeybogdanov
3月24日 评论:

Technical issue to make necessary changes in the interface_sdk-js repository is created.

https://gitcode.com/openharmony/arkcompiler_ets_frontend/issues/9633

Part 3

likedislike
sergeybogdanov
sergeybogdanov
3月31日 评论:

Current Status

The patch for repositories (planned Part 2 merge for this issue) is on hold because of new code merged into the master branch related to code generation in arkui_ace_engine repository. For now, in another task the generation script will be fixed. After that the changes in the patch would be reworked to meet new generation logic.

The patch for repository interface_sdk-js (planned Part 3 merge for this issue) is in progress. The main problem with the patch is the way how to get approve on the changes in the interface_sdk-js. Right now we are trying to setup local OHOS build to run the patch on local system and after that we can get approve on the changes.

To avoid to be stopped by the unfinished work we are trying to use whitelists to treat the override field warning as warning in known repositories and to treat them as errors in all other code base. In this way we can get list of problematic places which we can fix step by step.

likedislike
OOpenHarmony_CMO成员
6月24日 关闭了 issue
OOpenHarmony_CMO成员
6月24日 issue状态由 待办的 改变为 已完成