-
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
Add EViewInterface to LF - stub compilation/interpretation in speedy #14486
Conversation
CHANGELOG_BEGIN CHANGELOG_END
daml-lf/archive/src/main/protobuf/com/daml/daml_lf_dev/daml_lf_1.proto
Outdated
Show resolved
Hide resolved
iface <- inWorld (lookupInterface iface) | ||
unless (alphaType (intView iface) viewtype) $ | ||
throwWithContext ETypeMismatch{foundType = viewtype, expectedType = intView iface, expr = Nothing} | ||
checkExpr expr (TCon template) |
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'm not sure what type we want for the argument here, but ECallInterface
takes a TCon iface
checkExpr expr (TCon template) | |
checkExpr expr (TCon iface) |
@remyhaemmerle-da what do you think?
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.
The view
construct should be applied to an interface. In general when trying to get the view, we do not know the actual type of the template.
As explained in my previous comment, I think the definition of EViewInterface
should be simplify to something like.
EViewInterface
{ viewInterfaceInterface :: !(Qualified TypeConName)
, viewInterfaceExpr :: !Expr
}
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.
the haskell changes look good to me but please consider @remyhaemmerle-da's point about the information present/needed in the ECallInterface
expression constructor.
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 add EViewInterface as a possible expression type.
Calls to
view
will be desugared to this construct in a separate PR, #14456 .