onflow / cadence

Cadence, the resource-oriented smart contract programming language 🏃‍♂️
https://developers.flow.com/cadence
Apache License 2.0
526 stars 137 forks source link

Split typing from rest of type checker #2630

Open turbolent opened 1 year ago

turbolent commented 1 year ago

Issue to be solved

Currently, the checker is implemented in a way where determining the type of an expression and other checks, like if an expression can be assigned to (which has e.g. the side-effect of reporting an error), is interleaved.

In certain cases it is necessary to determine the type of an expression without any checks, as the result is needed as an input for checking another expression.

Suggested Solution

Split typing, determining the type of an expression, from the rest of the expression checking.

SupunS commented 1 month ago

Now that we are done with major changes to the type-checker, and don't have any on-going work either, probably a good time to get started on this. I can have look and maybe draft something together, and then we can evaluate. Or do you have any specific ideas in mind?