kadena-io / pact

The Pact Smart Contract Language
https://pact-language.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
580 stars 100 forks source link

fix tc step types #1333

Closed rsoeldner closed 5 months ago

rsoeldner commented 6 months ago

This PR enhances the typechecking for defpacts by ensuring consistency in return types across all steps. Previously, varying return types were permissible for each step. This update mandates that the return type for all steps aligns with the defpact's defined result type.

PR checklist:

Additionally, please justify why you should or should not do the following:

rsoeldner commented 6 months ago

I'd like to see a regression that addresses nested defpacts in here.

This PR concentrates solely on ensuring that each step's result type is consistent with the overall defpact type. While Stuart's nested defpact example remains a separate challenge, it is regarded as an independent issue and will be addressed in a future PR. This current update is dedicated to aligning step result types with the defpact's defined type.