I find it very confusing that for choices the placement of the do
token is handled differently for controller
first vs choice
first syntax.
With controller
first, you can leave the do
block at the end of the statement, like so:
controller counterparty can
Sell : ContractId FinancialContract with obligations: Obligations do
...
But with choice first, this doesn’t compile:
choice EnterInto : ContractId MasterAgreement with requestor : Party
controller requestor do
create MasterAgreement with bearer = requestor, counterparty
But moving the do
one line down does:
choice EnterInto : ContractId MasterAgreement with requestor : Party
controller requestor
do create MasterAgreement with bearer = requestor, counterparty
Is this intentional? Why this difference?