daml/daml-lf/tests/Interfaces.daml
Moisés Ackerman 2dbd91aab9
Interface methods can use plain function declaration syntax (#13102)
* Update 'implements' blocks to use new syntax

* Add InterfaceSyntax test case

* Add InterfaceMultipleMethodDeclsError test case

* Add InterfaceDifferentNumArgsError test case

changelog_begin
changelog_end
2022-03-02 15:59:01 +00:00

38 lines
741 B
Haskell

-- Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-- SPDX-License-Identifier: Apache-2.0
module Interfaces where
interface I1 where
getOwner1 : Party
choice C1 : ()
controller getOwner1 this
do pure ()
interface I2 where
getOwner2 : Party
choice C2 : ()
controller getOwner2 this
do pure ()
template T1
with
owner1 : Party
where
signatory owner1
implements I1 where
getOwner1 = owner1
choice OwnChoice : ()
controller owner1
do pure ()
template T2
with
owner2 : Party
where
signatory owner2
implements I1 where
getOwner1 = owner2
implements I2 where
getOwner2 = owner2