angular_analyzer_plugin icon indicating copy to clipboard operation
angular_analyzer_plugin copied to clipboard

Any way to avoid type errors in templates

Open zoechi opened this issue 8 years ago • 5 comments

These errors are quite annoying because I don't see any useful options to get rid of them

(ngModelChange)="update($event)"
                        ^^^^^^
ERROR: The argument type 'dynamic' can't be assigned to the parameter type 'bool'. ([fhir_client] lib/designer/webui/input/boolean_input_component.html:7)

I don't see any benefit of changing the parameter type of update(...) from bool to dynamic and I can't cast in templates.

zoechi avatar Jan 22 '17 14:01 zoechi

This should not happen. The code is valid dart.

@scheglov we are not resolving this specially. Any ideas which this would happen?

MichaelRFairhurst avatar Jan 23 '17 23:01 MichaelRFairhurst

I was not able to reproduce this. Does it generate the same error using pure Dart code?

scheglov avatar Jan 24 '17 00:01 scheglov

Nope, seems just fine when I make a little dart file. But we're not doing anything fancy in this case, just grabbing the type of ngModelChange on NgModel, settingthe enclosing class to the one with "update" as a member, and using the regular resolver visitors.

If nothing is obvious about how this could happen I'll have to dig in further

MichaelRFairhurst avatar Jan 24 '17 00:01 MichaelRFairhurst

Some more context

<material-checkbox tooltipTrigger
                     [ngModel]="model"
                     (ngModelChange)="update($event)"></material-checkbox>
  bool model;
 
  void update(bool value) {
    ...
  }

Dart VM version: 1.22.0-edge.7730809f360a00d9683057ffcfb9651453e7c1f4 (Sat Jan 21 00:04:30 2017) on "linux_x64"

updated the plugin as well yesterday.

zoechi avatar Jan 24 '17 09:01 zoechi

I get dozens of errors related to templates (not just like this one). Do you think you'll be able to tackle them soon? Otherwise you could perhaps prevent the false warnings in the meantime. Then it would become feasible to keep the plugin enabled. Currently I'm copying the analyzer snapshots with the plugin over the original one, when I want to check for Angular view errors, but then copy back the original snapshot to get rid of the noise.

zoechi avatar Apr 20 '17 10:04 zoechi