daml/compiler
Sofia Faro 5c12d757f4
Add a guard when exercising by interface. (#11836)
* Add a guard when exercising by interface.

This fixes part of #11703, when exercising an inherited choice by
interface and you know the template id, via the command preprocessor.

It does this by inserting a "guard" in between the interface fetch and
the exercise body. The guard is a function Interface -> Bool, which
is general enough to check the template id, without complicating too
much in speedy. And can be generalized in the future to check more,
like signatories, etc.

I added the guard as an optional argument to UExerciseByInterface.
This isn't hooked up to the protobuf AST yet (or Haskell side for
that matter) -- but I'll do it in the next PR! For now you can invoke
the guarded exercise via the command preprocessor, so I can enable the
approprate engine tests. (There's still some failing fetch tests left,
but I decided to leave this for later. Fetch can be a lot simpler than
guarded choices, since you always add a fetch node. No need for fancy
continuations.)

changelog_begin
changelog_end

* scalafmt

* Feedback and fix matches

* Update comments, we are always going to abort the transaction

* Raise WronglyTypedContract in SBGuardTemplateId.

* rebase and fix parser

* restore ANF

* scalafmt
2021-11-24 14:22:40 +00:00
..
daml-extension Address remaining dependabot alerts (#11045) 2021-09-28 11:12:14 +02:00
daml-lf-ast Drop LF < 1.14 from supported damlc output versions (#11701) 2021-11-22 16:20:17 +00:00
daml-lf-proto Remove precondition field from TemplateImplements (#11763) 2021-11-18 17:10:40 +01:00
daml-lf-reader DEL-8657 update version info for Haskell LF libraries (#10160) 2021-07-02 09:46:53 +10:00
daml-lf-tools Remove precondition field from TemplateImplements (#11763) 2021-11-18 17:10:40 +01:00
daml-lf-verify Drop controller can syntax from compiler tests (#10807) 2021-09-08 15:28:09 +02:00
damlc Drop LF < 1.14 from supported damlc output versions (#11701) 2021-11-22 16:20:17 +00:00
ghcide Get ghcide from the new upstream repo (#2867) 2019-09-11 08:57:48 +02:00
hie-core Get ghcide from the new upstream repo (#2867) 2019-09-11 08:57:48 +02:00
lsp-tests Drop flaky marker from lsp-tests (#11442) 2021-10-28 12:21:01 +02:00
repl-service LF: Clean up Ast (#11786) 2021-11-19 15:40:28 +01:00
scenario-service Add a guard when exercising by interface. (#11836) 2021-11-24 14:22:40 +00:00
README.md Daml case and logo (#8433) 2021-01-08 12:50:15 +00:00

Daml Compiler

This directory contains several libraries used by and the executable for the Daml compiler.

Libraries

  • daml-lf-ast: The Daml-LF AST and type checker.