fixes to handling of NBT tags. Fixes #1080

This commit is contained in:
gnembon committed 2021-09-04 23:44:45 -03:00
1 parent 9f30c47f19
commit 572fc8573e
2 files changed
+48 -28

No files matched your search

@@ -1216,6 +1216,7 @@ public class Expression
if (arg.op instanceof LazyValue.ContextFreeLazyValue) continue;
return optimized;
}
// a few exceptions which we don't implement in the framework for simplicity for now
if (!operation.pure())
{
if (symbol.equals("->") && expectedType == Context.Type.MAPDEF)
@@ -1226,6 +1227,14 @@ public class Expression
return optimized;
}
}
if (operation.pure())
{
// element access with constant elements will always resolve the same way.
if (symbol.equals(":") && expectedType == Context.Type.LVALUE)
{
expectedType = Context.Type.NONE;
}
}
List<LazyValue> args = new ArrayList<>(node.args.size());
for (ExpressionNode arg : node.args) {
try {