X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Felaboration%2Fexpressions%2FEVariable.java;h=155aa7578f3821d399e0e2fd227791a65e1850d7;hb=6320ecb3f75e3a29ed620ca5425ca22ef88a5496;hp=7fe0e0a92d3220ceaf604c24715d9a48a0865044;hpb=666ee533a3cfa9f59e79215a269f8342227cdbda;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EVariable.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EVariable.java index 7fe0e0a92..155aa7578 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EVariable.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EVariable.java @@ -132,8 +132,13 @@ public class EVariable extends Expression { variable.setType(Types.metaVar(Kinds.STAR)); return this; } - else + else { + if(variable.getType() == null) { + context.getErrorLog().log(location, "Type of the variable is not defined."); + variable.setType(Types.metaVar(Kinds.STAR)); + } return applyPUnit(context); + } } @Override @@ -142,8 +147,13 @@ public class EVariable extends Expression { variable.setType(requiredType); return this; } - else + else { + if(variable.getType() == null) { + context.getErrorLog().log(location, "Type of the variable is not defined."); + variable.setType(Types.metaVar(Kinds.STAR)); + } return context.subsume(this, requiredType); + } } @Override