Skip to content

Commit

Permalink
fix: union member names (#291)
Browse files Browse the repository at this point in the history
* feat: fix capitalization in unions
  • Loading branch information
ajewellamz authored Sep 28, 2023
1 parent cb402ee commit eede58f
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,6 @@ public TypeConverter generateUnionConverter(final UnionShape unionShape) {
.of(defNames
.stream()
.map(memberShape -> {
final String propertyNameEdgeCase = StringUtils.equals(nameResolver.classPropertyForStructureMember(memberShape), "KmsKeyArn") ? "kmsKeyArn" : nameResolver.classPropertyForStructureMember(memberShape);
final String propertyName = nameResolver.classPropertyForStructureMember(memberShape);
final String memberFromDafnyConverterName = typeConverterForShape(
memberShape.getId(), FROM_DAFNY);
Expand All @@ -569,7 +568,7 @@ public TypeConverter generateUnionConverter(final UnionShape unionShape) {
destructorValue = DafnyNameResolverHelpers.dafnyCompilesExtra_(memberShape.getMemberName());
}
return TokenTree
.of("if (value.is_%s)".formatted(propertyNameEdgeCase))
.of("if (value.is_%s)".formatted(memberShape.getMemberName()))
.append(TokenTree
.of(
"converted.%s = %s(concrete.dtor_%s);"
Expand Down

0 comments on commit eede58f

Please sign in to comment.