Closed JSAbrahams closed 2 years ago
In the unification stage, we have the position of the asts.
One option is to return a set of positions and types at that position.
Then, for each position, we can recursively go through the AST and as soon as the position is found we annotate that ASTTy
with the type.
I doubt this feature will really help with #278 , but still nice to have of course.
Current Issue
The type checker does not annotate the AST with types. This makes more "advanced" language features, such as automatically returning the last expression (without
return
), or treating a match as an expression more difficult.A few issues which would benefit:
278 wrapping literals. We only need to wrap them if we perform a function call. It would be redundant to wrap them in every location.
This also saves a lot of types which we can use to annotate our Python output. Throwing this away is a shame.