0

When using a material autocomplete (from angular-material 7.3.7), I always get an inspection error from IntelliJ. Code example:

<form>
  <mat-form-field>
    <input type="text" matInput [formControl]="myControl" [matAutocomplete]="auto">
    <mat-autocomplete #auto="matAutocomplete">
      <mat-option>foobar</mat-option>
    </mat-autocomplete>
  </mat-form-field>
</form>

The inspection error as shown from IntelliJ:

matAutocomplete inspection error

Specifically, the part [matAutocomplete]="auto" triggers an inspection error of the type AngularInvalidExpressionResultType.

Since the example is directly copied from angular-material and also custom code shows the same error, I'm starting to wonder if this is really an error or just a bug in the inspection.

The [autocomplete]-Input expects a type MatAutocomplete, which is provided, and so the error description doesn't even make sense.

Is this a bug in IntelliJ?

My IntelliJ version: IntelliJ IDEA 2019.1.3 (Ultimate Edition) / Build #IU-191.7479.19, built on May 28, 2019

adrianus
  • 3,141
  • 1
  • 22
  • 41
  • 1
    I am in `IntelliJ IDEA 2018.3.4` and I cannot reproduce this with the code you have given. Maybe try playing with your intellij version, or you need to change something in your settings, but the code you have looks right. – rhavelka Jun 05 '19 at 16:08
  • 2
    can't recreate in `#IU-191.7479.19` with `"@angular/material": "7.3.7"` using exactly same code. If the issue persists after caches invalidation (*File | Invalidate caches, Invalidate and restart*), please create a support ticket – lena Jun 05 '19 at 17:18
  • @lena After invalidating caches and a restart, the problem is gone, thank you very much! I'd vote your comment as accepted answer if I could :-) – adrianus Jun 06 '19 at 06:15
  • great, thanks for update:) – lena Jun 06 '19 at 11:37

0 Answers0