-
Notifications
You must be signed in to change notification settings - Fork 205
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
Expose conversion from Ast.Type to iface.Type #3511
Conversation
@@ -195,7 +195,7 @@ object InterfaceReader { | |||
: InterfaceReaderError \/ ImmArraySeq[(Ref.Name, Type)] = | |||
fields.toSeq traverseU { case (fieldName, typ) => type_(ctx, typ).map(x => fieldName -> x) } | |||
|
|||
private def type_( | |||
def type_( |
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.
@S11001001, @cocreature: what would be a bit more descriptive name for this?
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.
How about toIfaceType
?
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.
Renamed to toIfaceType
. Happy to change it to something else, I don’t care much for the name here.
671ccb1
to
06fa637
Compare
This allows me to get rid of the duplicated conversion logic for DAML script. The reason for why I can’t use the higher level APIs provided by the interface reader is that the type of the script identifier can be a function which is not serializable and therefore does not show up in the interface. However, I only want to translate the type of the argument of that function which is serializable.
06fa637
to
5938c3b
Compare
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.
Feel free to dismiss after applying.
daml-lf/interface/src/main/scala/com/digitalasset/daml/lf/iface/reader/InterfaceReader.scala
Outdated
Show resolved
Hide resolved
…e/reader/InterfaceReader.scala Co-Authored-By: Stephen Compall <stephen.compall@daml.com>
* Expose conversion from Ast.Type to iface.Type This allows me to get rid of the duplicated conversion logic for DAML script. The reason for why I can’t use the higher level APIs provided by the interface reader is that the type of the script identifier can be a function which is not serializable and therefore does not show up in the interface. However, I only want to translate the type of the argument of that function which is serializable. * Update daml-lf/interface/src/main/scala/com/digitalasset/daml/lf/iface/reader/InterfaceReader.scala Co-Authored-By: Stephen Compall <stephen.compall@daml.com>
This allows me to get rid of the duplicated conversion logic for DAML
script. The reason for why I can’t use the higher level APIs provided
by the interface reader is that the type of the script identifier can
be a function which is not serializable and therefore does not show up
in the interface. However, I only want to translate the type of the
argument of that function which is serializable.
Pull Request Checklist
NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with
/AzurePipelines run
totrigger the build.