title: Numba error: "LoweringError: Failed at nopython (nopython mode backend)"
body: <p>I'm trying to optimize a Python class using the numba class decorator.  I read the online instructions for the numba @jitclass <a href="http://numba.pydata.org/numba-doc/dev/user/jitclass.html" rel="nofollow noreferrer">guide</a>.  I need help figuring out what i'm doing wrong.  </p>
  
  <p>The class initializes an NxN Rubik's cube instantiated in a numpy array.  The step method twists the bottom cube face 90 degrees clockwise.  This class runs fine without the decorator but fails with it.  Thanks.</p>
  
  <pre><code>from numba import jitclass
  from numba import int32, int16, float32
  import numpy as np
  
  spec = [
      ('value', int16[:, :, ::1]),
      ('cube_dim', int16),
      ('c', int16[:, :, ::1]),
      ('slice1d', int16[::1]),
      ('slice2d', int16[:, ::1]),
      ('slice3d', int16[:, :, ::1])
  ]
  
  
  @jitclass(spec)
  class ncube:
      def __init__(self, cube_dim):
          self.cube_dim = cube_dim
          c = np.zeros(self.cube_dim * self.cube_dim, dtype=np.int16).reshape(self.cube_dim, self.cube_dim)
          c = np.concatenate((c, c + 1, c + 2, c + 3, c + 4, c + 5), axis=0).reshape(6, self.cube_dim, self.cube_dim)
          self.value = c
  
      def step(self, move):
          if move == 'D':
              # rotate F,B,L,R
              slice1d = self.value[[0, 1, 4, 5], self.cube_dim - 1, :].reshape(4 * self.cube_dim)
              slice2d = np.roll(slice1d, self.cube_dim).reshape(4, self.cube_dim)
              self.value[[0, 1, 4, 5], self.cube_dim - 1, :] = slice2d
              # rot D 90 degrees
              slice2d = self.value[3, :, :]
              np.rot90(slice2d, 1)
              self.value[3, :, :] = slice2d
  
      def __repr__(self):
          return str(self.value)
  
  
  c1 = ncube(3)
  c1.step('D')
  print(c1)
  </code></pre>
  
  <p>End of error Traceback:</p>
  
  <pre><code>numba.errors.LoweringError: Failed at nopython (nopython mode backend)
  
  File "test1.py", line 21
  [1] During: lowering "(self).value = c.1" at /Users/ericadar/test1.py (21)
  [2] During: resolving callee type: jitclass.ncube#7fc6c59146b8&lt;value:array(int16, 3d, C),cube_dim:int16,c:array(int16, 3d, C),slice1d:array(int16, 1d, C),slice2d:array(int16, 2d, C),slice3d:array(int16, 3d, C)&gt;
  [3] During: typing of call at &lt;string&gt; (3)
  --%&lt;-----------------------------------------------------------------
  
  File "&lt;string&gt;", line 3
  &gt;&gt;&gt; 
  </code></pre>