From 76c16886f7624c21b0ffec9cfe24fa579269d970 Mon Sep 17 00:00:00 2001 From: Ekkoruse Date: Fri, 27 Dec 2024 19:33:20 +0800 Subject: [PATCH] Add test cases for some lambda cases 1 test case added. Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/IBE9VB?from=project-issue Change-Id: I423833463360786f7c2ce37e4498ccf3abe91853 Signed-off-by: Ekkoruse --- .../ets/short_notion_of_void_lambdas.sts | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 ets2panda/test/runtime/ets/short_notion_of_void_lambdas.sts diff --git a/ets2panda/test/runtime/ets/short_notion_of_void_lambdas.sts b/ets2panda/test/runtime/ets/short_notion_of_void_lambdas.sts new file mode 100644 index 000000000..a8eaef98c --- /dev/null +++ b/ets2panda/test/runtime/ets/short_notion_of_void_lambdas.sts @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function outer(func:()=>void):void{ + func() +} +function inner(flag:boolean){ + if(flag) + return + assert(!flag) +} + +outer(()=>inner(true)) \ No newline at end of file -- Gitee