enso-org / enso

Hybrid visual and textual functional programming.
https://ensoanalytics.com
Apache License 2.0
7.36k stars 324 forks source link

Recognize type ascription / type signature distinction in compiler #11301

Open kazcw opened 1 week ago

kazcw commented 1 week ago

Currently the compiler IR doesn't distinguish between type-signature declarations and type-ascription expressions. As a result, when translating Tree.TypeSignature and Tree.TypeAnnotated the parser's distinction between these node types is lost, and later logic analyzing the IR makes an independent determination of whether to treat the node as a declaration or expression. To ensure the compiler's behavior is consistent with the AST, we should maintain the distinction made by the parser.

I don't think they should necessarily both be IR nodes:

kazcw commented 1 week ago

This is blocked by #11293 as currently that case is handled in the compiler instead of the parser.