]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/Expression.java
(refs #7371) Support expression cloning for ECHRSelect
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / expressions / Expression.java
index 427acbd19b9dbbdd082df33f7c8ca97b0792d3ed..3a2f845fe88191cb594022c5e0c49f60197b1db5 100644 (file)
@@ -61,10 +61,10 @@ public abstract class Expression extends Symbol implements Typed {
             try {
                 updateType();
             } catch (MatchException e) {
-                throw new InternalCompilerError(e);
+                throw new InternalCompilerError(location, e);
             }
             if(type == null)
-                throw new InternalCompilerError(getClass().getSimpleName() + 
+                throw new InternalCompilerError(location, getClass().getSimpleName() + 
                         ".updateType couldn't compute its type.");
         }
         return type;
@@ -242,7 +242,7 @@ public abstract class Expression extends Symbol implements Typed {
 
     public void getParameters(TranslationContext translationContext,
             ArrayList<Expression> parameters) {
-        throw new InternalCompilerError("Class " + getClass().getSimpleName() + " does not support getParameters.");        
+        throw new InternalCompilerError(location, "Class " + getClass().getSimpleName() + " does not support getParameters.");        
     }
 
     public Expression resolveAsPattern(TranslationContext context) {
@@ -252,7 +252,7 @@ public abstract class Expression extends Symbol implements Typed {
     
     public Expression checkTypeAsPattern(TypingContext context, Type requiredType) {
         if(context.isInPattern())
-            throw new InternalCompilerError("Already in a pattern.");
+            throw new InternalCompilerError(location, "Already in a pattern.");
         context.setInPattern(true);
         Expression expression = checkType(context, requiredType);
         context.setInPattern(false);
@@ -282,7 +282,7 @@ public abstract class Expression extends Symbol implements Typed {
     }
 
     public Expression replace(ReplaceContext context) {
-        throw new InternalCompilerError(getClass().getSimpleName() + " does not support replace.");
+        throw new InternalCompilerError(location, getClass().getSimpleName() + " does not support replace.");
     }
     
     public static Expression[] replace(ReplaceContext context, Expression[] expressions) {