From 1b2c2f705c444e9e145a091fdafe9bcfbdc458a0 Mon Sep 17 00:00:00 2001 From: Tatiana Titova Date: Fri, 27 Jun 2025 20:48:36 +0300 Subject: [PATCH] Add test for #26815 #26854 Signed-off-by: Tatiana Titova --- .../ets/LambdaParameterWithImplicitType.ets | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 ets2panda/test/ast/compiler/ets/LambdaParameterWithImplicitType.ets diff --git a/ets2panda/test/ast/compiler/ets/LambdaParameterWithImplicitType.ets b/ets2panda/test/ast/compiler/ets/LambdaParameterWithImplicitType.ets new file mode 100644 index 00000000000..2cde0dd6898 --- /dev/null +++ b/ets2panda/test/ast/compiler/ets/LambdaParameterWithImplicitType.ets @@ -0,0 +1,26 @@ +/* + * 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. + */ + +const foo = async (): Promise => { + return 42.0; // Return a double to satisfy the Promise +}; + +foo().then((result) => { // crash - issue #26815 + console.log(`Async function returned: ${result}`); +}); + +let fooArray = ["a", "b", "c"]; +let fooArrayMapped = fooArray.map(x => x + " is mapped"); // crash - issue #26856 +let fooArrayMappedAndChecked = fooArray.map(x => x == "a"); // crash - issue #26856 -- Gitee