Skip to content
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

Merged
merged 5 commits into from
Jul 21, 2022

Conversation

dylant-da
Copy link
Contributor

This add EViewInterface as a possible expression type.
Calls to view will be desugared to this construct in a separate PR, #14456 .

CHANGELOG_BEGIN
CHANGELOG_END
iface <- inWorld (lookupInterface iface)
unless (alphaType (intView iface) viewtype) $
throwWithContext ETypeMismatch{foundType = viewtype, expectedType = intView iface, expr = Nothing}
checkExpr expr (TCon template)
Copy link
Contributor

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

Suggested change
checkExpr expr (TCon template)
checkExpr expr (TCon iface)

@remyhaemmerle-da what do you think?

Copy link
Collaborator

@remyhaemmerle-da remyhaemmerle-da Jul 21, 2022

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
    }

Copy link
Contributor

@akrmn akrmn left a 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.

Copy link
Collaborator

@remyhaemmerle-da remyhaemmerle-da left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dylant-da dylant-da enabled auto-merge (squash) July 21, 2022 12:36
@dylant-da dylant-da merged commit 8d93efd into main Jul 21, 2022
@dylant-da dylant-da deleted the interface-views-lf-viewinterface branch July 21, 2022 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants