-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(feat): Add Positional Trait in Go codegen #7
base: scchatur/GoCodegen
Are you sure you want to change the base?
Conversation
return dereferencableShapes.contains(shape.toShapeId()); | ||
} | ||
} | ||
package software.amazon.polymorph.smithygo.codegen.knowledge; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened here? Why the whole file is in the diff??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This diff will go away once I merge new changes to this PR.
@@ -141,10 +144,20 @@ func NewClient(clientConfig $L) (*$T, error) { | |||
if (inputShape.hasTrait(UnitTypeTrait.class)) { | |||
baseClientCall = "var dafny_response = client.DafnyClient.%s()".formatted(operationShape.getId().getName()); | |||
} else { | |||
String dafnyType; | |||
if (inputShape.hasTrait(PositionalTrait.class)) { | |||
Shape inputForPositional = model.expectShape(inputShape.getAllMembers().values().stream().findFirst().get().getTarget()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not getAllMembers().get(0)
assuming it's a collection?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getAllMembers()
is a map but getAllMembers().values()
is a collection. However, collection does not have get
method.
if (outputShape.hasTrait(UnitTypeTrait.class)) { | ||
clientResponse = "var native_error"; | ||
returnResponse = "dafny.TupleOf()"; | ||
writer.addImportFromModule("github.com/dafny-lang/DafnyRuntimeGo", "dafny"); | ||
inputType = maybeInputType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: Why inputType is being assigned on a conditional on outputType?
// if (shape.isResourceShape()) { | ||
// // TypesNamespace for resources are in ShapeName | ||
// return shape.getId().getName(); | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the commented code.
* fix: bump Rust version to 1.80
…atically (smithy-lang#554) As is the case for many suites of GitHub actions, it's a huge pain to manually maintain the list of required checks in the branch protection. This change leverages https://github.com/re-actors/alls-green to add a single capstone action that only passes if all dependent jobs pass (see repo README for details on why the naive approach doesn't work). Once this is approved I'll update the required checks before merging. Also adding Python tests to the list of triggers in the nightly build since I noticed it was missing.
This reverts commit ca4d375.
No description provided.