#14271·enso

Template function boundaries - `_:Type` problem

Author: kazcwCreated Nov 10, 2025Updated Apr 30, 2026
Labels--bug-compiler-syntax-parser

There are some problems with our current parsing of template functions:

  • The "precedence" of the template token is not ideal--for example, the interpretation of _:Type is surprising and not useful (I think the current behaviour in this case could be considered a bug, but since it yields an error it can be fixed backward-compatibly).
  • Information about template function boundaries is not available to the frontend. The boundaries of template functions are determined in the backend. The parser creates TemplateFunction nodes, but it does so according to an analysis defined in a draft specification, that has not been put into practice.

We should fix this in two steps:

  • Bring the parser's template function boundary analysis in line with the backend's current behaviour (which is fairly simple), and remove the analysis from the backend, instead making use of the AST nodes.
  • Once template function boundaries are defined by the AST, improve them.