Skip to content

Commit e6330e4

Browse files
committed
add missing reference
1 parent 85c3faf commit e6330e4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/StructuredMemberWriter.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,9 +611,10 @@ private void writeConstraintValidatorType(TypeScriptWriter writer, Shape shape)
611611
Shape collectionMemberTargetShape = model.expectShape(collectionMemberShape.getTarget());
612612
writer.writeInline("Iterable<$T>", getSymbolForValidatedType(collectionMemberTargetShape));
613613
} else if (shape.isMapShape()) {
614+
MapShape mapShape = shape.asMapShape().get();
614615
writer.writeInline("Record<$T, $T>",
615-
getSymbolForValidatedType(((MapShape) shape).getKey()),
616-
getSymbolForValidatedType(((MapShape) shape).getValue())
616+
getSymbolForValidatedType(mapShape.getKey()),
617+
getSymbolForValidatedType(mapShape.getValue())
617618
);
618619
} else if (shape instanceof SimpleShape) {
619620
writer.writeInline("$T", getSymbolForValidatedType(shape));

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/SymbolVisitor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ public Symbol mapShape(MapShape shape) {
196196
Symbol key = toSymbol(shape.getKey());
197197
Symbol value = toSymbol(shape.getValue());
198198
return createSymbolBuilder(shape, format("Record<%s, %s>", key.getName(), value.getName()), null)
199+
.addReference(key)
199200
.addReference(value)
200201
.build();
201202
}

0 commit comments

Comments
 (0)