]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EFieldAccess.java
(refs #7316) Improved error locations for invalid field access
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / expressions / EFieldAccess.java
index 0d3e2eeaf3600e32aa1ca5206293f40d4182006d..a8d117f5df94d93d265c140355ebc8ea417fd65e 100644 (file)
@@ -67,7 +67,7 @@ public class EFieldAccess extends SimplifiableExpression {
             return null;
         List<Constant> accessors = context.getEnvironment().getFieldAccessors(idAccessor.fieldName);
         if(accessors == null) {
             return null;
         List<Constant> accessors = context.getEnvironment().getFieldAccessors(idAccessor.fieldName);
         if(accessors == null) {
-            context.getErrorLog().log("Couldn't resolve accessor ." + idAccessor.fieldName + ".");
+            context.getErrorLog().log(idAccessor.location, "Couldn't resolve accessor ." + idAccessor.fieldName + ".");
             return new EError(location);
         }
         Expression accessorExpression;
             return new EError(location);
         }
         Expression accessorExpression;
@@ -86,6 +86,10 @@ public class EFieldAccess extends SimplifiableExpression {
                     public Type getType() {
                         return accessors.get(index).getType();
                     }
                     public Type getType() {
                         return accessors.get(index).getType();
                     }
+                    @Override
+                    public String toString() {
+                        return accessors.get(index).toString();
+                    }
                 };
             }
             accessorExpression = new EAmbiguous(alternatives);
                 };
             }
             accessorExpression = new EAmbiguous(alternatives);