diff --git a/core/src/main/java/gyro/core/scope/NodeEvaluator.java b/core/src/main/java/gyro/core/scope/NodeEvaluator.java index bf13999cf..38bfaa3db 100644 --- a/core/src/main/java/gyro/core/scope/NodeEvaluator.java +++ b/core/src/main/java/gyro/core/scope/NodeEvaluator.java @@ -339,6 +339,12 @@ public void addTypeNode(Node top, Node node) { addTypeNode(top, item); } } + + if (node instanceof DirectiveNode) { + for (Node item : ((DirectiveNode) node).getBody()) { + addTypeNode(top, item); + } + } } public void evaluateBody(List body, Scope scope) { @@ -771,13 +777,7 @@ private Object resourceResolver(String resourceName, String referenceName, Refer s = s.filter(r -> DiffableInternals.getName(r).startsWith(prefix)); } - List resources = s.collect(Collectors.toList()); - - if (resources.isEmpty()) { - throw new FindDefer(node, referenceName, resourceName); - } - - value = resources; + value = s.collect(Collectors.toList()); } else { Resource resource = root.findResource(referenceName + "::" + resourceName);