diff --git a/SmithyDafnyMakefile.mk b/SmithyDafnyMakefile.mk index 2c08c8799..cab764694 100644 --- a/SmithyDafnyMakefile.mk +++ b/SmithyDafnyMakefile.mk @@ -532,7 +532,8 @@ polymorph_go: _polymorph_go: OUTPUT_GO=--output-go $(LIBRARY_ROOT)/runtimes/go/ _polymorph_go: MODULE_NAME=--library-name $(GO_MODULE_NAME) _polymorph_go: DEPENDENCY_MODULE_NAMES = $(GO_DEPENDENCY_MODULE_NAMES) -_polymorph_go: _polymorph _mv_polymorph_go run_goimports +#TODO: Drop go_imports till Dafny bugs are fix otherwise this fails +_polymorph_go: _polymorph _mv_polymorph_go run_goimports: cd runtimes/go/ImplementationFromDafny-go && goimports -w . diff --git a/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithygo/localservice/DafnyLocalServiceTypeConversionProtocol.java b/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithygo/localservice/DafnyLocalServiceTypeConversionProtocol.java index 860981efb..da5606c62 100644 --- a/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithygo/localservice/DafnyLocalServiceTypeConversionProtocol.java +++ b/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithygo/localservice/DafnyLocalServiceTypeConversionProtocol.java @@ -13,6 +13,7 @@ import software.amazon.polymorph.smithygo.localservice.nameresolver.SmithyNameResolver; import software.amazon.polymorph.smithygo.localservice.shapevisitor.DafnyToSmithyShapeVisitor; import software.amazon.polymorph.smithygo.localservice.shapevisitor.SmithyToDafnyShapeVisitor; +import software.amazon.smithy.aws.traits.ServiceTrait; import software.amazon.polymorph.traits.ExtendableTrait; import software.amazon.polymorph.traits.LocalServiceTrait; import software.amazon.polymorph.traits.ReferenceTrait; @@ -1280,6 +1281,9 @@ func Error_FromDafny(err $L.Error)(error) { if (dependencies == null) { return; } + var sdkId = serviceShape.hasTrait(LocalServiceTrait.class) + ? serviceShape.expectTrait(LocalServiceTrait.class).getSdkId() + : serviceShape.expectTrait(ServiceTrait.class).getSdkId().toLowerCase(); for (var dep : dependencies) { var depService = context .model() diff --git a/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithygo/localservice/shapevisitor/DafnyToSmithyShapeVisitor.java b/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithygo/localservice/shapevisitor/DafnyToSmithyShapeVisitor.java index 3a04f6ef0..cb292e220 100644 --- a/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithygo/localservice/shapevisitor/DafnyToSmithyShapeVisitor.java +++ b/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithygo/localservice/shapevisitor/DafnyToSmithyShapeVisitor.java @@ -506,8 +506,7 @@ public String integerShape(IntegerShape shape) { func() int32 { var b = %s.(int32) return b - }() - """.formatted(dataSource); + }()""".formatted(dataSource); } }