From 412e1b2826382144e6d66cad3c9a5540f2785542 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 9 Aug 2026 21:36:22 +0100 Subject: Make type params on native type node optional --- .../ast/untyped/UntypedNativeTypeDefinitionNodeMatcher.java | 2 +- .../compiler/parser/ParserNativeTypeDefinitionTests.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/test/java/org/zwobble') diff --git a/src/test/java/org/zwobble/hobgoblin/compiler/ast/untyped/UntypedNativeTypeDefinitionNodeMatcher.java b/src/test/java/org/zwobble/hobgoblin/compiler/ast/untyped/UntypedNativeTypeDefinitionNodeMatcher.java index e1f02a0..3105dae 100644 --- a/src/test/java/org/zwobble/hobgoblin/compiler/ast/untyped/UntypedNativeTypeDefinitionNodeMatcher.java +++ b/src/test/java/org/zwobble/hobgoblin/compiler/ast/untyped/UntypedNativeTypeDefinitionNodeMatcher.java @@ -36,7 +36,7 @@ public final class UntypedNativeTypeDefinitionNodeMatcher implements org.zwobble return new org.zwobble.hobgoblin.compiler.ast.untyped.UntypedNativeTypeDefinitionNodeMatcher(submatchers); } - public org.zwobble.hobgoblin.compiler.ast.untyped.UntypedNativeTypeDefinitionNodeMatcher withTypeParams(org.zwobble.precisely.Matcher> typeParams) { + public org.zwobble.hobgoblin.compiler.ast.untyped.UntypedNativeTypeDefinitionNodeMatcher withTypeParams(org.zwobble.precisely.Matcher>> typeParams) { var submatchers = new java.util.ArrayList>(this.submatchers); submatchers.add(org.zwobble.precisely.Matchers.has("typeParams", org.zwobble.hobgoblin.compiler.ast.untyped.UntypedNativeTypeDefinitionNode::typeParams, typeParams)); return new org.zwobble.hobgoblin.compiler.ast.untyped.UntypedNativeTypeDefinitionNodeMatcher(submatchers); diff --git a/src/test/java/org/zwobble/hobgoblin/compiler/parser/ParserNativeTypeDefinitionTests.java b/src/test/java/org/zwobble/hobgoblin/compiler/parser/ParserNativeTypeDefinitionTests.java index ca0a71d..444b392 100644 --- a/src/test/java/org/zwobble/hobgoblin/compiler/parser/ParserNativeTypeDefinitionTests.java +++ b/src/test/java/org/zwobble/hobgoblin/compiler/parser/ParserNativeTypeDefinitionTests.java @@ -39,7 +39,7 @@ public class ParserNativeTypeDefinitionTests { ); assertThat(node, isUntypedNativeTypeDefinitionNode() - .withTypeParams(isSequence()) + .withTypeParams(isOptionalEmpty()) ); } @@ -55,9 +55,9 @@ public class ParserNativeTypeDefinitionTests { ); assertThat(node, isUntypedNativeTypeDefinitionNode() - .withTypeParams(isSequence( + .withTypeParams(isOptionalOf(isSequence( isUntypedTypeParamNode().withName(equalTo("TPoint")) - )) + ))) ); } @@ -73,10 +73,10 @@ public class ParserNativeTypeDefinitionTests { ); assertThat(node, isUntypedNativeTypeDefinitionNode() - .withTypeParams(isSequence( + .withTypeParams(isOptionalOf(isSequence( isUntypedTypeParamNode().withName(equalTo("K")), isUntypedTypeParamNode().withName(equalTo("V")) - )) + ))) ); } } -- cgit v1.2.3