Currently, when typechecking a model, the checker adds the members to a partial model type in syntactic order. This means that sometimes the checker is unable to infer some types, and that the order in which members are defined matters.
This should be changed to check models in two passes:
- partially check all declaration, doing type inference, and build the complete model type
- check function and lambda declarations to make sure that they agree with the type found in the previous step
Currently, when typechecking a model, the checker adds the members to a partial model type in syntactic order. This means that sometimes the checker is unable to infer some types, and that the order in which members are defined matters.
This should be changed to check models in two passes: