From 7fa52f106f293f1136b6dc0871820ab80fe5b4c9 Mon Sep 17 00:00:00 2001 From: Andy Jewell Date: Fri, 10 Nov 2023 11:09:13 -0500 Subject: [PATCH] feat: make all type conversions public --- .../smithydotnet/TypeConversionCodegen.java | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) 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 299ff5fda..a103b79cd 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 @@ -1296,27 +1296,15 @@ protected TypeConverter buildConverterFromMethodBodies( } final String cSharpType = type; - - - // TODO It may be more stable to have _all_ converters be public. - // Right now the expectation is that a reference to a resource - // is the _only_ way to share types. - // By making them all public the surface area is increased. - // For any module that takes a dependency on this module, // they will need to wrap and unwrap reference types. // This is more controlled than exposing // the NativeWrapper and the Dafny wrapped type. - // However, if this type is already exposed - // from a dependent module - // leave that as the _only_ public converter - // and this converter is internal. final boolean isDependantModuleType = ModelUtils.isReferenceDependantModuleType(shape, nameResolver.namespaceForService()); - final String visibility = shape.hasTrait(ReferenceTrait.class) && !isDependantModuleType - ? "public" - : "internal"; + // Make all converters public, because most need to be and it's not worth the trouble to hide the remaining few. + final String visibility = "public"; final String fromDafnyConverterName = typeConverterForShape(id, FROM_DAFNY); final TokenTree fromDafnyConverterSignature = TokenTree.of(