This is an automated email from the ASF dual-hosted git repository.

joshtynjala pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git

commit 86fa033d62960c434d9e8e87d6bfe1fd4b147e81
Author: Josh Tynjala <[email protected]>
AuthorDate: Mon Oct 20 14:46:59 2025 -0700

    MethodBodySemanticChecker: performance optimization to return earlier from 
checkFunctionTypeMeta when expectedFunctionTypeMeta is null to avoid 
unnecessary resolve of right expression
---
 .../compiler/internal/semantics/MethodBodySemanticChecker.java      | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git 
a/compiler/src/main/java/org/apache/royale/compiler/internal/semantics/MethodBodySemanticChecker.java
 
b/compiler/src/main/java/org/apache/royale/compiler/internal/semantics/MethodBodySemanticChecker.java
index f0c995871..a07008135 100644
--- 
a/compiler/src/main/java/org/apache/royale/compiler/internal/semantics/MethodBodySemanticChecker.java
+++ 
b/compiler/src/main/java/org/apache/royale/compiler/internal/semantics/MethodBodySemanticChecker.java
@@ -277,7 +277,7 @@ public class MethodBodySemanticChecker
 
     private void checkFunctionTypeMeta(IMetaTag expectedFunctionTypeMeta, 
IASNode expectedFunctionTypeSite, IASNode rightNode)
     {
-        if (!(rightNode instanceof IExpressionNode))
+        if (!(rightNode instanceof IExpressionNode) || 
expectedFunctionTypeMeta == null)
         {
             return;
         }
@@ -285,10 +285,6 @@ public class MethodBodySemanticChecker
         IExpressionNode rightExpression = (IExpressionNode) rightNode;
         IDefinition resolvedRight = rightExpression.resolve(project);
 
-        if (expectedFunctionTypeMeta == null)
-        {
-            return;
-        }
         boolean checkParams = true;
 
         String expectedReturnTypeString = 
expectedFunctionTypeMeta.getAttributeValue(IMetaAttributeConstants.NAME_FUNCTION_TYPE_RETURNS);

Reply via email to