我有以下代码:
template Iou
with
issuer : Party
owner : Party
amount : Decimal
currency : Text
where
signatory issuer
mergeIou : Iou -> Iou -> Iou
mergeIou a b =
-- assert $ a.issuer == b.issuer
-- assert $ a.owner == b.owner
-- assert $ a.currency == b.currency
a with amount = a.amount + b.amount
当我取消注释任何断言时,我收到以下错误:
* Couldn't match expected type `Iou' with actual type `m0 ()'
* In the expression:
assert
$ (DA.Internal.Record.getField @"issuer" a)
...
我究竟做错了什么?