diff options
| author | Michael Williamson <mike@zwobble.org> | 2024-12-19 17:40:38 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2024-12-19 17:40:38 +0000 |
| commit | dc0b16c61be0a41eda8a0f94d41118808e46d567 (patch) | |
| tree | 4f24fbc3226240190d1f8d114882b044c3ee5f2e /src/test/java | |
| parent | b758aab829a5ddb20fd5284b1fad581db36742c6 (diff) | |
Type check methods fully
Diffstat (limited to 'src/test/java')
| -rw-r--r-- | src/test/java/org/shedlang/compiler/typechecker/TypeCheckerStructDefinitionTests.java | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/test/java/org/shedlang/compiler/typechecker/TypeCheckerStructDefinitionTests.java b/src/test/java/org/shedlang/compiler/typechecker/TypeCheckerStructDefinitionTests.java index dee72117..116a7b6a 100644 --- a/src/test/java/org/shedlang/compiler/typechecker/TypeCheckerStructDefinitionTests.java +++ b/src/test/java/org/shedlang/compiler/typechecker/TypeCheckerStructDefinitionTests.java @@ -289,30 +289,30 @@ public class TypeCheckerStructDefinitionTests { UntypedFunctionDefinitionNode.builder() .addPositionalParam("this", Optional.empty()) .withName("a") - .withReturnType(Untyped.typeLevelReference("Bool")) + .withReturnType(Untyped.typeLevelReference("Unit")) .build() ) .build(); var context = TypeCheckerContext.EMPTY .enterGlobal(P.map( - Map.entry("Bool", Types.metaType(Types.BOOL)) + Map.entry("Unit", Types.metaType(Types.UNIT)) )); var typed = typeCheckNamespaceStatement(untyped, context); -// assertThat( -// typed.value(), -// isTypedStructDefinitionNode() -// .withMethods(isSequence( -// isTypedFunctionDefinitionNode() -// .withParams(isTypedParamsNode( -// isSequence( -// isTypedParamNode("this", isOptionalEmpty()) -// ), -// isSequence() -// )) -// )) -// ); + assertThat( + typed.value(), + isTypedStructDefinitionNode() + .withMethods(isSequence( + isTypedFunctionDefinitionNode() + .withParams(isTypedParamsNode( + isSequence( + isTypedParamNode("this", isOptionalEmpty()) + ), + isSequence() + )) + )) + ); var structTypeInfo = typed.context().toTypeInfos() .structTypeInfo(Types.struct(NAMESPACE_NAME, "ExampleStruct")) .orElseThrow(); @@ -323,7 +323,7 @@ public class TypeCheckerStructDefinitionTests { "a", FunctionType.builder() .addPositionalParam(Types.struct(NAMESPACE_NAME, "ExampleStruct")) - .withReturnType(Types.BOOL) + .withReturnType(Types.UNIT) .build() )) )) |
