diff --git a/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithydotnet/TypeConversionCodegen.java b/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithydotnet/TypeConversionCodegen.java index 8b4455fc7..aa19e7bfe 100644 --- a/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithydotnet/TypeConversionCodegen.java +++ b/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithydotnet/TypeConversionCodegen.java @@ -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); @@ -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);"