39 Star 58 Fork 407

OpenHarmony / arkcompiler_runtime_core

 / 详情

[Bug]: [ArkTS] [runtime] Verifier error: ensure non-nullish result of expression with ternary conditional operator

已完成
创建于  
2024-05-08 14:31

发生了什么问题?

The following code failed to verifier.

function main(): void {
  let i: Int|undefined|null = 5;
  let ii: Int|undefined|null = null;
  assert (0 ? ii : i)!;
}

期望行为是什么?

Expected verification passed, and verifier has no output.

如何复现该缺陷

test.ets

function main(): void {
  let i: Int|undefined|null = 5;
  let ii: Int|undefined|null = null;
  assert (0 ? ii : i)!;
}

Use following command:

runtime_core/static_core/build/bin/es2panda --arktsconfig=runtime_core/static_core/build/tools/es2panda/generated/arktsconfig.json --gen-stdlib=false --extension=ets --opt-level=0 test.ets
runtime_core/static_core/build/bin/verifier --boot-panda-files=runtime_core/static_core/build/plugins/ets/etsstdlib.abc --load-runtimes=ets --config-file=runtime_core/static_core/tests/tests-u-runner/runner/plugins/ets/ets-verifier.config test.abc

Verifier reports an error, as following:

[TID 05c969] E/verifier: Verifier error 31: Bad call incompatible parameter
[TID 05c969] E/verifier: Error: method void ETSGLOBAL::main() failed to verify

其他补充信息

版本或分支信息

  • master
  • Release 4.1
  • Release 4.0
  • Release 3.2

评论 (1)

yuanxupeng 创建了任务
yuanxupeng 添加了
 
bug
标签
展开全部操作日志

感谢提交Issue!关于Issue的交互操作,请访问OpenHarmony社区支持命令清单。如果有问题,请联系 @godmiaozi @peijiajun @Ishin Pavel @Vyacheslav Cherkashin 。如果需要调整订阅PR、Issue的变更状态,请访问链接

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

openharmony_ci 添加了
 
waiting_for_assign
标签
yuanxupeng 任务状态待办的 修改为进行中
yuanxupeng 修改了描述
yuanxupeng 任务状态进行中 修改为已完成

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(2)
7387629 openharmony ci 1656582662
1
https://gitee.com/openharmony/arkcompiler_runtime_core.git
git@gitee.com:openharmony/arkcompiler_runtime_core.git
openharmony
arkcompiler_runtime_core
arkcompiler_runtime_core

搜索帮助

344bd9b3 5694891 D2dac590 5694891