已关闭
[问题咨询]: await from outside of an async function/method should cte #8694
fanglou创建于  2025年12月25日关闭于  2月10日
fanglou
fanglou
2025年12月25日 创建

感谢提出问题,我们将安排人答复!

问题描述

async function noParams(): Promise<int>{return 12}

function test(){
    await noParams()  // shoule CTE here
}

function main(){
    test()
}
likedislike
fangloufanglou
2025年12月25日 添加了label:question
openharmony_ci
openharmony_ci成员
2025年12月25日 评论:

感谢提交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成员
2025年12月25日 添加了label:waiting_for_assign
fanglou
fanglou
2025年12月26日 评论:

now it report warning: Await in non-aysnc function is deprecated, please move it to async function.

likedislike
fangloufanglou
2月7日 关联了pull request:await must in async function
fangloufanglou
2月7日 关联了pull request:await must in async function
fangloufanglou
2月7日 关联了pull request:await must in async function
fangloufanglou
2月7日 关联了pull request:await must in async function
fangloufanglou
2月7日 关联了pull request:await must in async function
fangloufanglou
2月9日 关联了pull request:await must in async
openharmony_ciopenharmony_ci成员
2月10日 关闭了 issue