Parse error on input ‘<-’
- axnblueOP
template PersonalContract with signat : Party h : Party number : Int where signatory signat controller hos can ExtraFunc : Optional (ContractId Demo) do if number == 1 then **temp <- create Demo with** signat = signat h = h return (Some temp) else return None template Demo with signat : Party h : Party where signatory signat - drsk 2
Hi @axnbl
You’ll need adoafter thethencontroller hos can ExtraFunc : Optional (ContractId Demo) do if number == 1 then do temp <- create $ Demo with signat = signat, h = h return (Some temp) else return None - axnblue
But it will create the Demo Contract. I dont want to create it unless or until number == 1. Is there any other way to do that?
- cocreature 2
That’s exactly what @drsk’s example will do. Adding the
dodoes no tchange the fact that it will only be created if the number is 1. - axnblue 1
ohh okay… got it