- Fixed some wrongs in data matching, causing crashes with onlyWithTag in some cases

- Fixed a variable check when resolving variables
This commit is contained in:
Stan Hebben committed 2014-10-14 23:33:10 +02:00
1 parent f20af21fef
commit 59ef38877f
15 files changed
+119 -44

No files matched your search

@@ -31,6 +31,11 @@ public class ParsedExpressionVariable extends ParsedExpression {
public IPartialExpression compile(IEnvironmentMethod environment, ZenType predictedType) {
IPartialExpression result = environment.getValue(name, getPosition());
if (result == null) {
if (predictedType == null) {
environment.error(getPosition(), "could not find " + name);
return new ExpressionInvalid(getPosition());
}
// enable usage of static members of the same type as the predicted type (eg. enum values)
IPartialExpression member = predictedType.getStaticMember(getPosition(), environment, name);
if (member == null || member.getType().getCastingRule(predictedType, environment) == null) {