title: Understanding Numba TypingError with jit nopython
body: <p>I'm having trouble solving a (probably basic) Numba error, using <code>@jit(nopython=True)</code>. It boils down to the minimal example below, which produces a <code>TypingError</code> (full logs below). If relevant, I'm using Python 3.6.10 and Numba v0.49.0.</p>
  
  <p>The error happens at the <code>d</code> line creating the numpy array (if I remove <code>d</code> and return <code>c</code>, it works fine). How can I solve this?</p>
  
  <pre class="lang-py prettyprint-override"><code>from numba import jit
  import numpy as np
  
  n = 5
  foo = np.random.rand(n,n)
  
  @jit(nopython=True)
  def bar(x):
      a = np.array([0,3,2])
      b = np.array([1,2,3])
      c = [x[i,j] for i,j in zip(a,b)]
      # print(c) # Un-commenting this line solves the issue‽ (per @Ethan's comment)
      d = np.array(c)
      return d
  
  baz = bar(foo)
  </code></pre>
  
  <p>Full error follows:</p>
  
  <pre><code>---------------------------------------------------------------------------
  TypingError                               Traceback (most recent call last)
  &lt;ipython-input-13-950d2be33d72&gt; in &lt;module&gt;
       14     return d
       15 
  ---&gt; 16 baz = bar(foo)
       17 print(baz)
  
  ~/miniconda3/envs/py3k/lib/python3.6/site-packages/numba/core/dispatcher.py in _compile_for_args(self, *args, **kws)
      399                 e.patch_message(msg)
      400 
  --&gt; 401             error_rewrite(e, 'typing')
      402         except errors.UnsupportedError as e:
      403             # Something unsupported is present in the user code, add help info
  
  ~/miniconda3/envs/py3k/lib/python3.6/site-packages/numba/core/dispatcher.py in error_rewrite(e, issue_type)
      342                 raise e
      343             else:
  --&gt; 344                 reraise(type(e), e, None)
      345 
      346         argtypes = []
  
  ~/miniconda3/envs/py3k/lib/python3.6/site-packages/numba/core/utils.py in reraise(tp, value, tb)
       77         value = tp()
       78     if value.__traceback__ is not tb:
  ---&gt; 79         raise value.with_traceback(tb)
       80     raise value
       81 
  
  TypingError: Failed in nopython mode pipeline (step: nopython frontend)
  Invalid use of Function(&lt;intrinsic range_iter_len&gt;) with argument(s) of type(s): (zip(iter(array(int64, 1d, C)), iter(array(int64, 1d, C))))
   * parameterized
  In definition 0:
      All templates rejected with literals.
  In definition 1:
      All templates rejected without literals.
  This error is usually caused by passing an argument of a type that is unsupported by the named function.
  [1] During: resolving callee type: Function(&lt;intrinsic range_iter_len&gt;)
  [2] During: typing of call at &lt;ipython-input-13-950d2be33d72&gt; (9)
  
  
  File "&lt;ipython-input-13-950d2be33d72&gt;", line 9:
  def bar(x):
      a = np.array([0,3,2])
      ^
  </code></pre>
  
  <p><em>Update:</em> Using the following function instead fails in a similar manner (though the <code>print(c)</code> trick does not help in this case):</p>
  
  <pre class="lang-py prettyprint-override"><code>@jit(nopython=True)
  def bar(x):
      a = [0,3,2]
      b = [1,2,3]
      c = x[a, b]
      d = np.array(c)
      return d
  </code></pre>