aboutsummaryrefslogtreecommitdiff
path: root/src/test/java
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-10-29 16:45:50 +0000
committerMichael Williamson <mike@zwobble.org>2023-10-29 16:45:50 +0000
commitd8f4fea9c5f303551d17d3644356fcf0e30804b1 (patch)
tree33d5a29926b3f26a62ef26c16645dd448ec877e5 /src/test/java
parent4981c362227679caabbe7178b1e54f6aaa6c84c0 (diff)
Remove type from typed function signature node
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionDefinitionNodeMatcher.java2
-rw-r--r--src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionExpressionNodeMatcher.java2
-rw-r--r--src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionSignatureNodeMatcher.java6
-rw-r--r--src/test/java/org/shedlang/compiler/typechecker/TypeCheckerFunctionSignatureTests.java10
4 files changed, 2 insertions, 18 deletions
diff --git a/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionDefinitionNodeMatcher.java b/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionDefinitionNodeMatcher.java
index 06963d8d..e12a187d 100644
--- a/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionDefinitionNodeMatcher.java
+++ b/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionDefinitionNodeMatcher.java
@@ -55,6 +55,6 @@ public class TypedFunctionDefinitionNodeMatcher extends MatcherBuilder<TypedName
}
public TypedFunctionDefinitionNodeMatcher withType(FunctionType type) {
- return with(has("type", x -> x.signature().type(), equalTo(type)));
+ return with(has("type", x -> x.type(), equalTo(type)));
}
}
diff --git a/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionExpressionNodeMatcher.java b/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionExpressionNodeMatcher.java
index a2c047ec..b47fb39c 100644
--- a/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionExpressionNodeMatcher.java
+++ b/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionExpressionNodeMatcher.java
@@ -59,6 +59,6 @@ public class TypedFunctionExpressionNodeMatcher extends MatcherBuilder<
}
public TypedFunctionExpressionNodeMatcher withType(FunctionType type) {
- return with(has("type", x -> x.signature().type(), equalTo(type)));
+ return with(has("type", x -> x.type(), equalTo(type)));
}
}
diff --git a/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionSignatureNodeMatcher.java b/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionSignatureNodeMatcher.java
index e93d45fe..2661d4fb 100644
--- a/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionSignatureNodeMatcher.java
+++ b/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionSignatureNodeMatcher.java
@@ -3,12 +3,10 @@ package org.shedlang.compiler.ast.typed;
import org.pcollections.Empty;
import org.pcollections.PVector;
import org.shedlang.compiler.testing.MatcherBuilder;
-import org.shedlang.compiler.types.FunctionType;
import org.zwobble.precisely.Matcher;
import java.util.Optional;
-import static org.zwobble.precisely.Matchers.equalTo;
import static org.zwobble.precisely.Matchers.has;
public class TypedFunctionSignatureNodeMatcher extends MatcherBuilder<
@@ -49,8 +47,4 @@ public class TypedFunctionSignatureNodeMatcher extends MatcherBuilder<
public TypedFunctionSignatureNodeMatcher withReturnType(Matcher<TypedTypeLevelExpressionNode<?>> returnType) {
return with(has("returnType", x -> x.returnType(), returnType));
}
-
- public TypedFunctionSignatureNodeMatcher withType(FunctionType type) {
- return with(has("type", x -> x.type(), equalTo(type)));
- }
}
diff --git a/src/test/java/org/shedlang/compiler/typechecker/TypeCheckerFunctionSignatureTests.java b/src/test/java/org/shedlang/compiler/typechecker/TypeCheckerFunctionSignatureTests.java
index 512c5650..580a24aa 100644
--- a/src/test/java/org/shedlang/compiler/typechecker/TypeCheckerFunctionSignatureTests.java
+++ b/src/test/java/org/shedlang/compiler/typechecker/TypeCheckerFunctionSignatureTests.java
@@ -4,12 +4,9 @@ import org.junit.jupiter.api.Test;
import org.shedlang.compiler.ast.untyped.Untyped;
import org.shedlang.compiler.ast.untyped.UntypedFunctionSignatureNode;
import org.shedlang.compiler.types.Effects;
-import org.shedlang.compiler.types.FunctionType;
-import org.shedlang.compiler.types.NamedParam;
import org.shedlang.compiler.types.Types;
import org.shedlang.compiler.util.P;
-import java.util.List;
import java.util.Map;
import static org.shedlang.compiler.ast.typed.TypedNodeMatchers.*;
@@ -34,7 +31,6 @@ public class TypeCheckerFunctionSignatureTests {
.withParams(isTypedParamsNode(isSequence(), isSequence()))
.withEffect(isOptionalEmpty())
.withReturnType(isTypedTypeLevelReferenceNode("Unit", Types.UNIT))
- .withType(new FunctionType(List.of(), List.of(), Effects.NONE, Types.UNIT))
);
}
@@ -63,12 +59,6 @@ public class TypeCheckerFunctionSignatureTests {
isSequence(isTypedParamNode("y", isTypedTypeLevelReferenceNode("Int", Types.INT)))
)
)
- .withType(new FunctionType(
- List.of(Types.STRING),
- List.of(new NamedParam("y", Types.INT)),
- Effects.NONE,
- Types.UNIT
- ))
);
}