angular_analyzer_plugin icon indicating copy to clipboard operation
angular_analyzer_plugin copied to clipboard

Warn about void interpolation expressions

Open chalin opened this issue 6 years ago • 2 comments

IMHO, an issue should be reported by the analyzer when the static type of an interpolated expression is void as in the following example:

@Component(
  selector: 'example',
  template: '{{foo()}}',
)
class C {
  void foo() {}
}

cc @kwalrath

chalin avatar Apr 13 '18 13:04 chalin

Nit: it won't be void unless you bind {{foo()}}, but yes, agreed! Same goes for [x]="voidResult()"

MichaelRFairhurst avatar Apr 17 '18 15:04 MichaelRFairhurst

(Right! I've fixed the example.)

chalin avatar Apr 17 '18 15:04 chalin