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 a datatype context tag for templates, and use it during LFConversion. #11198

Closed
sofiafaro-da opened this issue Oct 11, 2021 · 0 comments · Fixed by #11275
Closed

Add a datatype context tag for templates, and use it during LFConversion. #11198

sofiafaro-da opened this issue Oct 11, 2021 · 0 comments · Fixed by #11275

Comments

@sofiafaro-da
Copy link
Contributor

For interfaces and exceptions we add DatatypeContexts/"stupid theta" tags during parsing/desugaring so we can identify them later during LFConversion:

  • exception E desugars to data DamlException => E
  • interface I desugars to data DamlInterface => I

But for historical reasons we don't do that with templates. Instead, template types are unmarked, and we detect them based on the presence of a HasSignatory instance. We're now running into issues with this approach, because we want to implement HasSignatory for interfaces. It would be nice if, instead, we desugared templates the same way:

  • template T desugars to data DamlTemplate => T

And then only use that in LFConversion to detect template types. This would be a damlc-internal change. It does not affect Daml LF, in any way, and is backward-compatible with Daml.

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 a pull request may close this issue.

1 participant