Parse error in pattern: exercise Possibly caused by a missing 'do'?
- Muhammad_MoizOP 1
Hi, EveryOne I want to save the current date and time. I do following but get this error I search on the network but can’t able to solve it
template Attandance with systemUser : Party associate : Optional Party punchInTime : Optional Time punchOutTime :Optional Time where signatory systemUser nonconsuming choice PunchIn : ContractId Attandance with currentTime : Time controller associate do create this with punchInTime = Some currentTime nonconsuming choice PunchOut : ContractId Attandance with currentTime : Time controller associate do create this with punchOutTime = Some currentTimeHere is my scenario of update punchIn but it show me error when i exercised PunchIn exercise
Parse error in pattern: exercise
Possibly caused by a missing ‘do’?atid <- submit systemUser do create Attandance with systemUser associate = None punchInTime = None punchOutTime = None submit associate do exercise asid PunchIn with currentTime <- getTime return() - SamirTalwar 2
You’ll need to run getTime on a separate line. Something like:
submit associate do currentTime <- getTime exercise asid PunchIn with currentTimeI don’t think you can use <- syntax in a with block like that. I do think we need a better error message, but unfortunately I expect this is part of GHC and therefore we have limited ability to change it.