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
The following commit(s) were added to refs/heads/develop by this push:
new 8d7818191 MethodBodySemanticChecker: when checking strict function
types, if expected parameter is optional, actual parameter must be optional too
8d7818191 is described below
commit 8d78181917d95c6501dc1a521fc4ce9e497492ff
Author: Josh Tynjala <[email protected]>
AuthorDate: Wed Oct 29 15:56:46 2025 -0700
MethodBodySemanticChecker: when checking strict function types, if expected
parameter is optional, actual parameter must be optional too
---
.../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 a07008135..6b93a4018 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
@@ -377,6 +377,11 @@ public class MethodBodySemanticChecker
isInvalidSignature = true;
break;
}
+ if (expectedParam.hasDefaultValue() &&
!actualParam.hasDefaultValue())
+ {
+ isInvalidSignature = true;
+ break;
+ }
}
}
if (!isInvalidSignature)