title: ngIf gives 'TypeError: Cannot read property 'visit' of undefined' when indexing into array
body: <p>I have an ngIf inside an ngFor and I use the index to check whether the item at that index of an array is equal to a certain value but whenever I try to index anything it gives a</p>
  <pre><code>Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
  TypeError: Cannot read property 'visit' of undefined 
  at AstTranslator.translate (&lt;projdirectory&gt;/node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\expression.js:81:24)
  </code></pre>
  <pre><code>progress.component.ts 
  import { Component, OnInit } from '@angular/core';
  
  @Component({
      selector: 'app-progress',
      templateUrl: './progress.component.html',
      styleUrls: ['./progress.component.scss']
  })
  export class ProgressComponent implements OnInit {
      temp = [
               &quot;Complete&quot;,
              &quot;NotAttempted&quot;,
              &quot;NotAttempted&quot;,
              &quot;NotAttempted&quot;,
              &quot;NotAttempted&quot;,
              &quot;NotAttempted&quot;,
              &quot;NotAttempted&quot; 
             ]
      tasks = [some array of same length]
      constructor() { }
  
      ngOnInit(): void {
      }
  
  }
  </code></pre>
  <pre><code>progress.component.html
  
  &lt;div class=&quot;container&quot;&gt;
      &lt;div class=&quot;wrapper&quot;&gt;
        
          &lt;table class = &quot;items&quot;&gt;
              &lt;thead&gt;
                  &lt;tr class = &quot;header-row&quot;&gt;
                      &lt;th class = &quot;title-header&quot;&gt;Title&lt;/th&gt;
                      &lt;th class = &quot;due-header&quot;&gt;Due Date&lt;/th&gt;
                      &lt;th class = &quot;status-header&quot;&gt;Status&lt;/th&gt;
                  &lt;/tr&gt;
              &lt;/thead&gt;
              &lt;tbody&gt; 
                  &lt;tr *ngFor=&quot;let task of tasks; let index = index&quot;&gt;
                      &lt;td&gt;{{ task.title }}&lt;/td&gt;
                      &lt;td&gt;{{ task.dueDate}}&lt;/td&gt;
                      &lt;td&gt;
                         &lt;div class = &quot;complete&quot; *ngIf=&quot;temp[index]==='Complete'&quot;&gt;Complete &lt;/div&gt;
                      &lt;/td&gt; 
                  &lt;/tr&gt;
              &lt;/tbody&gt;
          &lt;/table&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>I don't understand how temp is undefined since it is hardcoded?
  rough stackblitz example: <a href="https://stackblitz.com/edit/angular-ivy-xdk4jr?file=package.json" rel="nofollow noreferrer">https://stackblitz.com/edit/angular-ivy-xdk4jr?file=package.json</a>
  let me know if other files are required.</p>