If I have a structure like this:
operation GetIntegerOutputPosition {
input: GetIntegerOutputPositionInput
output: GetIntegerOutputPositionOutput,
}
structure GetIntegerOutputPositionInput {
value: Integer
}
@positional
structure GetIntegerOutputPositionOutput {
value: Integer
}
From this model, the Dafny code will be polymorph'ed as
method GetIntegerOutputPosition ( input: GetIntegerOutputPositionInput )
returns (output: Result<int32, Error>)
Which is wrong because based on the model the return type should be Option.
To resolve this issue, there are two solutions:
- The polymorph should fail with a validation error.
- This should be generated as Option but not int32
If I have a structure like this:
From this model, the Dafny code will be polymorph'ed as
Which is wrong because based on the model the return type should be Option.
To resolve this issue, there are two solutions: