dart-archive / angular_analyzer_plugin

WORK MOVED TO dart-lang/angular repository
https://github.com/dart-lang/angular/tree/master/angular_analyzer_plugin
68 stars 13 forks source link

First pass at pipe support, check return type of pipes. (#621) #622

Closed MichaelRFairhurst closed 6 years ago

MichaelRFairhurst commented 6 years ago

Some issues with pipe parsing offsets, and deserialization fixed.

Otherwise, we stick the pipe name & args into the AST properties, and our already existing override of ResolverVisitor can find the synthetic nodes for pipes and set the propagated type accordingly.

Haven't yet handled optional arguments -- I likely will run into issues where the argument expressions need to be hit by each of the visitors. So I may be better off doing a synthetic function call node that's treated specially, rather than the previous cast technique which was more for making an AST node that would result in the right analysis. That's no longer necessary if we're hijacking analysis, and we want the children of the pipe (when the pipe has optional arguments) to be typechecked safely which means its probably best to make them first-class citizens.