You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by jo...@apache.org on 2025/10/20 21:47:13 UTC
(royale-compiler) branch develop updated (a3870b307 -> 86fa033d6)
This is an automated email from the ASF dual-hosted git repository.
joshtynjala pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git
from a3870b307 compiler-common: missed a guava 33.5.0-jre and failureaccess 1.0.3 for Maven
new f0bf881b1 MethodBodySemanticChecker: added missing strict function types check for values of return statements
new 86fa033d6 MethodBodySemanticChecker: performance optimization to return earlier from checkFunctionTypeMeta when expectedFunctionTypeMeta is null to avoid unnecessary resolve of right expression
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../internal/semantics/MethodBodySemanticChecker.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
(royale-compiler) 01/02: MethodBodySemanticChecker: added missing strict function types check for values of return statements
Posted by jo...@apache.org.
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 f0bf881b1291982c5aeb5ed4a6bb39426e99ac1a
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Mon Oct 20 14:45:35 2025 -0700
MethodBodySemanticChecker: added missing strict function types check for values of return statements
---
.../compiler/internal/semantics/MethodBodySemanticChecker.java | 5 +++++
1 file changed, 5 insertions(+)
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 051838c80..f0c995871 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
@@ -2660,6 +2660,11 @@ public class MethodBodySemanticChecker
}
else
{
+ if (project.getAllowStrictFunctionTypes() && project.getBuiltinType(BuiltinType.FUNCTION).equals(return_type))
+ {
+ IMetaTag expectedFunctionTypeMeta = func_def.getMetaTagByName(IMetaAttributeConstants.ATTRIBUTE_FUNCTION_TYPE);
+ checkFunctionTypeMeta(expectedFunctionTypeMeta, iNode, returnExpression);
+ }
checkImplicitConversion(returnExpression, return_type, null);
}
(royale-compiler) 02/02: MethodBodySemanticChecker: performance optimization to return earlier from checkFunctionTypeMeta when expectedFunctionTypeMeta is null to avoid unnecessary resolve of right expression
Posted by jo...@apache.org.
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 <jo...@apache.org>
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);