-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fix: handle positional trait in resources #725
Fix: handle positional trait in resources #725
Conversation
""".formatted( | ||
fromDafnyConvMethodName, | ||
typeAssertion, | ||
deReferenceRequired |
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.
Do we always return a value type for Positional Output? Otherwise this might fail.
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.
returnResponse = | ||
"%s(%snative_response)".formatted( | ||
fromDafnyConvMethodNameForOutput, | ||
deReferenceRequired ? "*" : "" |
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.
I prefer this style over what's done at 923.
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.
Yes. Remove the if else and added ternary instead of it. Now its line 922
w.write( | ||
""" | ||
$L($L) ($L error) | ||
""", | ||
operationShape.getId().getName(), | ||
input, | ||
output | ||
output.equals("") ? "" : output.concat(",") |
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.
You can also use .isEmpty()
check.
Issue #, if available:
Description of changes:
Positional trait was not being handled in Referenced Resources. This PR fixes it.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.