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 03cb32260250326eb7ab5540661625b3a227cbed
Author: Josh Tynjala <[email protected]>
AuthorDate: Mon Jun 10 10:24:04 2019 -0700

    DynamicAccessNode: fixed issue where errors were not reported for undefined 
fields/methods on objects in a vector (references #80)
    
    Example: vec[0].fakeMethod() did not result in an error if the type of 
elements in the vector don't define fakeMethod()
    
    The Flex SDK compiler correctly reports an error, so this makes the Royale 
compiler behave the same
---
 .../apache/royale/compiler/internal/tree/as/DynamicAccessNode.java   | 5 +++++
 1 file changed, 5 insertions(+)

diff --git 
a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/as/DynamicAccessNode.java
 
b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/as/DynamicAccessNode.java
index dd974a7..b616b9d 100644
--- 
a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/as/DynamicAccessNode.java
+++ 
b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/as/DynamicAccessNode.java
@@ -72,6 +72,11 @@ public class DynamicAccessNode extends 
BinaryOperatorNodeBase implements IDynami
     @Override
     public boolean isDynamicExpression(ICompilerProject project)
     {
+        ITypeDefinition leftType = getLeftOperandNode().resolveType(project);
+        if (leftType instanceof IAppliedVectorDefinition)
+        {
+            return super.isDynamicExpression(project);
+        }
         return true;
     }
     

Reply via email to