From 535dbbd7dba533deae47f49f8f36c97eaf5fe05a Mon Sep 17 00:00:00 2001 From: Mingyang Date: Mon, 14 Jul 2025 11:56:30 +0800 Subject: [PATCH] Fix CTE Report For Arrow Function Missing Return Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/ICM3Z3 Reason: es2panda doesn't report CTE if lambda body doesn't have corresponding return statement. For const f = ():number => {} frontend should report CTE but it does not. Description: Add CTE judgement for lambda body. Tests: ninja tests passed tests/tests-u-runner/runner.sh --ets-cts --show-progress --build-dir x64.release --processes=all passed tests/tests-u-runner/runner.sh --ets-func-tests --show-progress --build-dir x64.release --processes=all passed tests/tests-u-runner/runner.sh --astchecker --show-progress --build-dir x64.release --processes=all passed tests/tests-u-runner/runner.sh --ets-runtime --show-progress --build-dir x64.release --processes=all passed tests/tests-u-runner/runner.sh --parser --no-js --show-progress --build-dir x64.release --processes=all passed Signed-off-by: Mingyang --- ets2panda/checker/ets/aliveAnalyzer.cpp | 73 +++++++++++++++++++ ets2panda/checker/ets/aliveAnalyzer.h | 5 +- .../ets/LambdaParameterWithImplicitType.ets | 2 + .../arrow_function_missing_return_value.ets | 26 +++++++ .../ets/trailing_lambda_statements.ets | 4 + .../ast/compiler/ets/unnecessary_boxing.ets | 6 ++ .../validReturnThisOfExtensionFunction.ets | 2 + .../ets/type_decution_unnecessary_boxing.ets | 9 ++- .../generics_implicit_lambda1-expected.txt | 2 + ...a_infer_type_arrow_expression-expected.txt | 1 + ...type_arrow_expression_literal-expected.txt | 1 + .../lambda_infer_type_has_return-expected.txt | 1 + ...ambda_infer_type_return_array-expected.txt | 1 + ...mbda_infer_type_return_lambda-expected.txt | 3 + ...bda_infer_type_return_lambda1-expected.txt | 1 + ...bda_infer_type_return_literal-expected.txt | 1 + ...ambda_infer_type_return_union-expected.txt | 1 + .../ets/loopWithinLambda-expected.txt | 2 + .../parser/ets/FunctionInSwitch-expected.txt | 1 + .../parser/ets/async_with_lambda-expected.txt | 2 + .../parser/ets/await_keyword-expected.txt | 8 ++ .../ets/lambda-type-inference-expected.txt | 3 + ...pressionWithoutBlockStatement-expected.txt | 1 + ...atementWithFunctionParameters-expected.txt | 1 + ets2panda/test/parser/ets/launch-expected.txt | 1 + 25 files changed, 156 insertions(+), 2 deletions(-) create mode 100644 ets2panda/test/ast/compiler/ets/arrow_function_missing_return_value.ets rename ets2panda/test/{runtime/ets/function_type_with_receiver => ast/compiler/ets}/validReturnThisOfExtensionFunction.ets (90%) diff --git a/ets2panda/checker/ets/aliveAnalyzer.cpp b/ets2panda/checker/ets/aliveAnalyzer.cpp index e4edb04a7a..04ab1a0058 100644 --- a/ets2panda/checker/ets/aliveAnalyzer.cpp +++ b/ets2panda/checker/ets/aliveAnalyzer.cpp @@ -81,10 +81,22 @@ void AliveAnalyzer::AnalyzeNode(const ir::AstNode *node) AnalyzeMethodDef(node->AsMethodDefinition()); break; } + case ir::AstNodeType::ARROW_FUNCTION_EXPRESSION: { + AnalyzeArrFuncExp(node->AsArrowFunctionExpression()); + break; + } case ir::AstNodeType::VARIABLE_DECLARATION: { AnalyzeVarDef(node->AsVariableDeclaration()); break; } + case ir::AstNodeType::ASSIGNMENT_EXPRESSION: { + AnalyzeAssignExp(node->AsAssignmentExpression()); + break; + } + case ir::AstNodeType::CLASS_PROPERTY: { + AnalyzeClassProp(node->AsClassProperty()); + break; + } case ir::AstNodeType::BLOCK_STATEMENT: { AnalyzeStats(node->AsBlockStatement()->Statements()); break; @@ -273,6 +285,48 @@ void AliveAnalyzer::AnalyzeMethodDef(const ir::MethodDefinition *methodDef) ClearPendingExits(); } +void AliveAnalyzer::AnalyzeArrFuncExp(const ir::ArrowFunctionExpression *arrFuncExp) +{ + auto *func = arrFuncExp->Function(); + + if (func->Body() == nullptr || func->IsProxy()) { + return; + } + + status_ = LivenessStatus::ALIVE; + AnalyzeStat(func->Body()); + ES2PANDA_ASSERT(arrFuncExp->TsType() && arrFuncExp->TsType()->IsETSFunctionType()); + const auto *returnType = arrFuncExp->TsType()->AsETSFunctionType()->ArrowSignature()->ReturnType(); + const auto isVoid = returnType->IsETSVoidType() || returnType == checker_->GlobalVoidType(); + const auto unionHasVoid = + returnType->IsETSUnionType() && + std::find_if(returnType->AsETSUnionType()->ConstituentTypes().begin(), + returnType->AsETSUnionType()->ConstituentTypes().end(), [this](const Type *type) { + return type->IsETSVoidType() || type == checker_->GlobalVoidType(); + }) != returnType->AsETSUnionType()->ConstituentTypes().end(); + + auto isPromiseVoid = false; + + if (returnType->IsETSObjectType() && + returnType->AsETSObjectType()->AssemblerName() == compiler::Signatures::BUILTIN_PROMISE) { + const auto *asAsync = returnType->AsETSObjectType(); + isPromiseVoid = asAsync->TypeArguments().front() == checker_->GlobalETSUndefinedType() || + asAsync->TypeArguments().front() == checker_->GlobalVoidType(); + } + + const bool isAsyncArrow = func->IsAsync(); + if (status_ == LivenessStatus::ALIVE && !isVoid && !isPromiseVoid && !isAsyncArrow && !unionHasVoid) { + if (!func->HasReturnStatement()) { + checker_->LogError(diagnostic::MISSING_RETURN_STMT, {}, arrFuncExp->Start()); + ClearPendingExits(); + return; + } + checker_->LogError(diagnostic::NONRETURNING_PATHS, {}, arrFuncExp->Start()); + } + + ClearPendingExits(); +} + void AliveAnalyzer::AnalyzeVarDef(const ir::VariableDeclaration *varDef) { for (auto *it : varDef->Declarators()) { @@ -284,6 +338,25 @@ void AliveAnalyzer::AnalyzeVarDef(const ir::VariableDeclaration *varDef) } } +void AliveAnalyzer::AnalyzeAssignExp(const ir::AssignmentExpression *assignExp) +{ + if (assignExp->Left() != nullptr) { + AnalyzeNode(assignExp->Left()); + } + if (assignExp->Right() != nullptr) { + AnalyzeNode(assignExp->Right()); + } +} + +void AliveAnalyzer::AnalyzeClassProp(const ir::ClassProperty *prop) +{ + if (!prop->NeedInitInStaticBlock()) { + if (prop->Value() != nullptr) { + AnalyzeNode(prop->Value()); + } + } +} + void AliveAnalyzer::AnalyzeDoLoop(const ir::DoWhileStatement *doWhile) { SetOldPendingExits(PendingExits()); diff --git a/ets2panda/checker/ets/aliveAnalyzer.h b/ets2panda/checker/ets/aliveAnalyzer.h index ade9092244..1d4f742ace 100644 --- a/ets2panda/checker/ets/aliveAnalyzer.h +++ b/ets2panda/checker/ets/aliveAnalyzer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Copyright (c) 2021-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 @@ -65,7 +65,10 @@ private: void AnalyzeStructDecl(const ir::ETSStructDeclaration *structDecl); void AnalyzeClassDecl(const ir::ClassDeclaration *classDecl); void AnalyzeMethodDef(const ir::MethodDefinition *methodDef); + void AnalyzeArrFuncExp(const ir::ArrowFunctionExpression *arrFuncExp); void AnalyzeVarDef(const ir::VariableDeclaration *varDef); + void AnalyzeAssignExp(const ir::AssignmentExpression *assignExp); + void AnalyzeClassProp(const ir::ClassProperty *prop); void AnalyzeDoLoop(const ir::DoWhileStatement *doWhile); void AnalyzeWhileLoop(const ir::WhileStatement *whileStmt); void AnalyzeForLoop(const ir::ForUpdateStatement *forStmt); diff --git a/ets2panda/test/ast/compiler/ets/LambdaParameterWithImplicitType.ets b/ets2panda/test/ast/compiler/ets/LambdaParameterWithImplicitType.ets index 2cde0dd689..fe359d4167 100644 --- a/ets2panda/test/ast/compiler/ets/LambdaParameterWithImplicitType.ets +++ b/ets2panda/test/ast/compiler/ets/LambdaParameterWithImplicitType.ets @@ -24,3 +24,5 @@ foo().then((result) => { // crash - issue #2 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 + +/* @@? 26:5 Warning Warning: Unreachable statement. */ \ No newline at end of file diff --git a/ets2panda/test/ast/compiler/ets/arrow_function_missing_return_value.ets b/ets2panda/test/ast/compiler/ets/arrow_function_missing_return_value.ets new file mode 100644 index 0000000000..6a48753044 --- /dev/null +++ b/ets2panda/test/ast/compiler/ets/arrow_function_missing_return_value.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 f = /* @@ label1 */():number => {} +let g = /* @@ label2 */():number => {} +function main(): void { + let h = /* @@ label3 */():number => {} + const i = /* @@ label4 */():number => {} +} + +/* @@@ label1 Error TypeError: Function with a non void return type must return a value. */ +/* @@@ label2 Error TypeError: Function with a non void return type must return a value. */ +/* @@@ label3 Error TypeError: Function with a non void return type must return a value. */ +/* @@@ label4 Error TypeError: Function with a non void return type must return a value. */ \ No newline at end of file diff --git a/ets2panda/test/ast/compiler/ets/trailing_lambda_statements.ets b/ets2panda/test/ast/compiler/ets/trailing_lambda_statements.ets index 9562b97a8e..2f57c0d632 100644 --- a/ets2panda/test/ast/compiler/ets/trailing_lambda_statements.ets +++ b/ets2panda/test/ast/compiler/ets/trailing_lambda_statements.ets @@ -39,3 +39,7 @@ let a = foo() { } return 1 } + +/* @@? 33:9 Warning Warning: Unreachable statement. */ +/* @@? 36:5 Warning Warning: Unreachable statement. */ +/* @@? 40:5 Warning Warning: Unreachable statement. */ \ No newline at end of file diff --git a/ets2panda/test/ast/compiler/ets/unnecessary_boxing.ets b/ets2panda/test/ast/compiler/ets/unnecessary_boxing.ets index 30f408b2bf..e490a4c914 100644 --- a/ets2panda/test/ast/compiler/ets/unnecessary_boxing.ets +++ b/ets2panda/test/ast/compiler/ets/unnecessary_boxing.ets @@ -18,3 +18,9 @@ let y:()=>int = ()=>16 as int y = true ? y:():int=>32 y = true ? ():int=>32:y + +/* @@? 16:2 Warning Warning: Unreachable statement. */ +/* @@? 17:2 Warning Warning: Unreachable statement. */ +/* @@? 18:6 Warning Warning: Unreachable statement. */ +/* @@? 19:2 Warning Warning: Unreachable statement. */ +/* @@? 20:2 Warning Warning: Unreachable statement. */ \ No newline at end of file diff --git a/ets2panda/test/runtime/ets/function_type_with_receiver/validReturnThisOfExtensionFunction.ets b/ets2panda/test/ast/compiler/ets/validReturnThisOfExtensionFunction.ets similarity index 90% rename from ets2panda/test/runtime/ets/function_type_with_receiver/validReturnThisOfExtensionFunction.ets rename to ets2panda/test/ast/compiler/ets/validReturnThisOfExtensionFunction.ets index f506d8ea78..034cde4498 100644 --- a/ets2panda/test/runtime/ets/function_type_with_receiver/validReturnThisOfExtensionFunction.ets +++ b/ets2panda/test/ast/compiler/ets/validReturnThisOfExtensionFunction.ets @@ -21,3 +21,5 @@ let y: (this: A, n: number) => this; function foo(a: A, ff:(this: A, n: number) => this) {}; function foo2(ff:(this: A, n: number) => this, a:A) {}; function foo3(this: A, n: number):this {return this}; + +/* @@? 20:1 Error TypeError: Function with a non void return type must return a value. */ diff --git a/ets2panda/test/ast/parser/ets/type_decution_unnecessary_boxing.ets b/ets2panda/test/ast/parser/ets/type_decution_unnecessary_boxing.ets index f527a78056..109aa9535a 100644 --- a/ets2panda/test/ast/parser/ets/type_decution_unnecessary_boxing.ets +++ b/ets2panda/test/ast/parser/ets/type_decution_unnecessary_boxing.ets @@ -19,4 +19,11 @@ x = true ? x:():long=>32 let y:()=>int = ()=>16 as int y = true ? y:():int=>32 y = true ? ():int=>32:y -x = true ? x:"apple" \ No newline at end of file +x = true ? x:"apple" + +/* @@? 17:1 Warning Warning: Unreachable statement. */ +/* @@? 18:1 Warning Warning: Unreachable statement. */ +/* @@? 19:5 Warning Warning: Unreachable statement. */ +/* @@? 20:1 Warning Warning: Unreachable statement. */ +/* @@? 21:1 Warning Warning: Unreachable statement. */ +/* @@? 22:1 Warning Warning: Unreachable statement. */ \ No newline at end of file diff --git a/ets2panda/test/compiler/ets/generics_implicit_lambda1-expected.txt b/ets2panda/test/compiler/ets/generics_implicit_lambda1-expected.txt index ded3411769..00910c3a9c 100644 --- a/ets2panda/test/compiler/ets/generics_implicit_lambda1-expected.txt +++ b/ets2panda/test/compiler/ets/generics_implicit_lambda1-expected.txt @@ -2506,3 +2506,5 @@ } } } +Warning: Unreachable statement. [generics_implicit_lambda1.ets:38:5] +Warning: Unreachable statement. [generics_implicit_lambda1.ets:40:5] diff --git a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_arrow_expression-expected.txt b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_arrow_expression-expected.txt index 94ab0e2a26..44f67e9ab1 100644 --- a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_arrow_expression-expected.txt +++ b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_arrow_expression-expected.txt @@ -849,3 +849,4 @@ } } } +Warning: Unreachable statement. [lambda_infer_type_arrow_expression.ets:19:9] diff --git a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_arrow_expression_literal-expected.txt b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_arrow_expression_literal-expected.txt index 84d41df13b..de15ee154a 100644 --- a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_arrow_expression_literal-expected.txt +++ b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_arrow_expression_literal-expected.txt @@ -802,3 +802,4 @@ } } } +Warning: Unreachable statement. [lambda_infer_type_arrow_expression_literal.ets:19:9] diff --git a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_has_return-expected.txt b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_has_return-expected.txt index 84661a9951..8acfba759f 100644 --- a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_has_return-expected.txt +++ b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_has_return-expected.txt @@ -963,3 +963,4 @@ } } } +Warning: Unreachable statement. [lambda_infer_type_has_return.ets:22:9] diff --git a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_array-expected.txt b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_array-expected.txt index 46493e52c9..169b5a5193 100644 --- a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_array-expected.txt +++ b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_array-expected.txt @@ -832,3 +832,4 @@ } } } +Warning: Unreachable statement. [lambda_infer_type_return_array.ets:19:3] diff --git a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_lambda-expected.txt b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_lambda-expected.txt index 1b6f4822a1..cb64d4b05f 100644 --- a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_lambda-expected.txt +++ b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_lambda-expected.txt @@ -723,3 +723,6 @@ } } } +Warning: Unreachable statement. [lambda_infer_type_return_lambda.ets:21:9] +Warning: Unreachable statement. [lambda_infer_type_return_lambda.ets:23:5] +Warning: Unreachable statement. [lambda_infer_type_return_lambda.ets:24:5] diff --git a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_lambda1-expected.txt b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_lambda1-expected.txt index 74a58d79df..1d103dbc8d 100644 --- a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_lambda1-expected.txt +++ b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_lambda1-expected.txt @@ -560,3 +560,4 @@ } } } +Warning: Unreachable statement. [lambda_infer_type_return_lambda1.ets:18:5] diff --git a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_literal-expected.txt b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_literal-expected.txt index e52b2b93df..a2456b761d 100644 --- a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_literal-expected.txt +++ b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_literal-expected.txt @@ -541,3 +541,4 @@ } } } +Warning: Unreachable statement. [lambda_infer_type_return_literal.ets:20:5] diff --git a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_union-expected.txt b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_union-expected.txt index 15901d7ccc..382908a7dc 100644 --- a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_union-expected.txt +++ b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_union-expected.txt @@ -783,3 +783,4 @@ } } } +Warning: Unreachable statement. [lambda_infer_type_return_union.ets:21:3] diff --git a/ets2panda/test/compiler/ets/loopWithinLambda-expected.txt b/ets2panda/test/compiler/ets/loopWithinLambda-expected.txt index a281d834d8..e0acbc1c5f 100644 --- a/ets2panda/test/compiler/ets/loopWithinLambda-expected.txt +++ b/ets2panda/test/compiler/ets/loopWithinLambda-expected.txt @@ -1806,3 +1806,5 @@ } } } +Warning: Unreachable statement. [loopWithinLambda.ets:22:5] +Warning: Unreachable statement. [loopWithinLambda.ets:24:5] diff --git a/ets2panda/test/parser/ets/FunctionInSwitch-expected.txt b/ets2panda/test/parser/ets/FunctionInSwitch-expected.txt index 5d047a8903..dd1a273b10 100644 --- a/ets2panda/test/parser/ets/FunctionInSwitch-expected.txt +++ b/ets2panda/test/parser/ets/FunctionInSwitch-expected.txt @@ -878,3 +878,4 @@ } } } +Warning: Unreachable statement. [FunctionInSwitch.ets:29:17] diff --git a/ets2panda/test/parser/ets/async_with_lambda-expected.txt b/ets2panda/test/parser/ets/async_with_lambda-expected.txt index 9e47c47d77..1ba2ea539b 100644 --- a/ets2panda/test/parser/ets/async_with_lambda-expected.txt +++ b/ets2panda/test/parser/ets/async_with_lambda-expected.txt @@ -2441,3 +2441,5 @@ } } } +Warning: Unreachable statement. [async_with_lambda.ets:33:5] +Warning: Unreachable statement. [async_with_lambda.ets:38:5] diff --git a/ets2panda/test/parser/ets/await_keyword-expected.txt b/ets2panda/test/parser/ets/await_keyword-expected.txt index 250f778f45..a6dc9436d7 100644 --- a/ets2panda/test/parser/ets/await_keyword-expected.txt +++ b/ets2panda/test/parser/ets/await_keyword-expected.txt @@ -4539,3 +4539,11 @@ } } } +Warning: Unreachable statement. [await_keyword.ets:18:5] +Warning: Unreachable statement. [await_keyword.ets:19:5] +Warning: Unreachable statement. [await_keyword.ets:24:5] +Warning: Unreachable statement. [await_keyword.ets:25:5] +Warning: Unreachable statement. [await_keyword.ets:30:5] +Warning: Unreachable statement. [await_keyword.ets:33:5] +Warning: Unreachable statement. [await_keyword.ets:38:5] +Warning: Unreachable statement. [await_keyword.ets:39:5] diff --git a/ets2panda/test/parser/ets/lambda-type-inference-expected.txt b/ets2panda/test/parser/ets/lambda-type-inference-expected.txt index d25ca49fb4..7da2bbc662 100644 --- a/ets2panda/test/parser/ets/lambda-type-inference-expected.txt +++ b/ets2panda/test/parser/ets/lambda-type-inference-expected.txt @@ -2865,3 +2865,6 @@ } } } +Warning: Unreachable statement. [lambda-type-inference.ets:39:5] +Warning: Unreachable statement. [lambda-type-inference.ets:43:5] +Warning: Unreachable statement. [lambda-type-inference.ets:46:5] diff --git a/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatement-expected.txt b/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatement-expected.txt index 530d73f802..eee6cd109a 100644 --- a/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatement-expected.txt +++ b/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatement-expected.txt @@ -672,3 +672,4 @@ } } } +Warning: Unreachable statement. [lambdaExpressionWithoutBlockStatement.ets:19:5] diff --git a/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatementWithFunctionParameters-expected.txt b/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatementWithFunctionParameters-expected.txt index 3030f08377..632b99dce7 100644 --- a/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatementWithFunctionParameters-expected.txt +++ b/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatementWithFunctionParameters-expected.txt @@ -828,3 +828,4 @@ } } } +Warning: Unreachable statement. [lambdaExpressionWithoutBlockStatementWithFunctionParameters.ets:18:5] diff --git a/ets2panda/test/parser/ets/launch-expected.txt b/ets2panda/test/parser/ets/launch-expected.txt index 98f6cb3e8d..c16459a41b 100755 --- a/ets2panda/test/parser/ets/launch-expected.txt +++ b/ets2panda/test/parser/ets/launch-expected.txt @@ -4004,3 +4004,4 @@ } } } +Warning: Unreachable statement. [launch.ets:47:3] -- Gitee