enso-org / enso

Enso Analytics is a self-service data prep and analysis platform designed for data teams.
https://ensoanalytics.com
Apache License 2.0
7.39k stars 323 forks source link

Recognize type ascription / type signature distinction in compiler #11301

Open kazcw opened 1 month ago

kazcw commented 1 month 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 month ago

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