aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/shedlang/compiler/ast
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-10-20 18:55:42 +0100
committerMichael Williamson <mike@zwobble.org>2023-10-20 18:55:55 +0100
commit8c9b4c92c1493d96d4bb2a5b88bf9e98e3a584e2 (patch)
tree876266a4f385d8c373538d74aa243949d7ae21fc /src/test/java/org/shedlang/compiler/ast
parentef4b9d4241777933cfba1a7140597a36c8d93638 (diff)
Support import of namespaces in type checker
Diffstat (limited to 'src/test/java/org/shedlang/compiler/ast')
-rw-r--r--src/test/java/org/shedlang/compiler/ast/typed/TypedNodeMatchers.java2
-rw-r--r--src/test/java/org/shedlang/compiler/ast/untyped/Untyped.java4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/test/java/org/shedlang/compiler/ast/typed/TypedNodeMatchers.java b/src/test/java/org/shedlang/compiler/ast/typed/TypedNodeMatchers.java
index c5281090..1fe83958 100644
--- a/src/test/java/org/shedlang/compiler/ast/typed/TypedNodeMatchers.java
+++ b/src/test/java/org/shedlang/compiler/ast/typed/TypedNodeMatchers.java
@@ -194,7 +194,7 @@ public class TypedNodeMatchers {
public static Matcher<TypedNamespaceNode> isTypedNamespaceNode(
Matcher<Iterable<? extends TypedNamespaceStatementNode>> body,
- Matcher<Iterable<? extends String>> fieldNames
+ Matcher<? super Iterable<? extends String>> fieldNames
) {
return allOf(
has("body", x -> x.body(), body),
diff --git a/src/test/java/org/shedlang/compiler/ast/untyped/Untyped.java b/src/test/java/org/shedlang/compiler/ast/untyped/Untyped.java
index 2c2aad8c..3e925601 100644
--- a/src/test/java/org/shedlang/compiler/ast/untyped/Untyped.java
+++ b/src/test/java/org/shedlang/compiler/ast/untyped/Untyped.java
@@ -102,6 +102,10 @@ public class Untyped {
return new UntypedIfNode(conditionalBranches, elseBody, Sources.NULL);
}
+ public static UntypedImportNode import_(NamespaceName namespaceName) {
+ return new UntypedImportNode(namespaceName, Sources.NULL);
+ }
+
public static UntypedIntLiteralNode intLiteral(int value) {
return new UntypedIntLiteralNode(BigInteger.valueOf(value), Sources.NULL);
}