# Buggy code
def generic(self, args, kws):
    assert not kws
    ary, idx, val = args
    if not isinstance(ary, types.Buffer):
        return
    if not ary.mutable:
        raise TypeError("Cannot modify value of type %s" % (ary,))
    out = get_array_index_type(ary, idx)
    if out is None:
        return

    idx = out.index
    res = out.result
    if isinstance(res, types.Array):
        # Indexing produces an array
        if isinstance(val, types.Array):
            if not self.context.can_convert(val.dtype, res.dtype):
                # DType conversion not possible
                return
            else:
                res = val
        elif isinstance(val, types.Sequence):
            if res.ndim == 1 and self.context.can_convert(val.dtype, res.dtype):
                # Allow assignement of sequence to 1d array
                res = val
            else:
                # NOTE: sequence-to-array broadcasting is unsupported
                return
        else:
            # Allow scalar broadcasting
            if self.context.can_convert(val, res.dtype):
                res = res.dtype
            else:
                # Incompatible scalar type
                return
    elif not isinstance(val, types.Array):
        # Single item assignment
        res = val
    else:
        return
    return signature(types.none, ary, idx, res)


# Traceback (TypeError)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-15-3b23f7331ceb> in <module>()
----> 1 @jit(arg_types=[numba.double], ret_type=numba.double)
2 def is_REALLY_five(some_value):
3     for i in range(5):
4         if some_value == 5.0:
5             return 1.0

/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/numba/decorators.pyc in _jit(func)
77                   "garbage collected!" % (func,))
78         t = Translate(func, *args, **kws)
---> 79         t.translate()
80         __tr_map__[func] = t
81         return t.get_ctypes_func(llvm)

/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/numba/translate.pyc in translate(self)
926                     # Ensure we are playing with locals that might
927                     # actually precede the next block.
--> 928                     self.check_locals(i)
929
930                 self.crnt_block = i

/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/numba/translate.pyc in check_locals(self, i)
1135                 else:
1136                     assert next_locals is not None, "Internal compiler error!"
-> 1137             self._locals = next_locals[:]
1138
1139     def get_ctypes_func(self, llvm=True):

TypeError: 'NoneType' object has no attribute '__getitem__'

# Fixed code
def generic(self, args, kws):
    assert not kws
    ary, idx, val = args
    if not isinstance(ary, types.Buffer):
        return
    if not ary.mutable:
        raise TypeError("Cannot modify value of type %s" % (ary,))
    out = get_array_index_type(ary, idx)
    if out is None:
        return

    idx = out.index
    res = out.result
    if isinstance(res, types.Array):
        # Indexing produces an array
        if isinstance(val, types.Array):
            if not self.context.can_convert(val.dtype, res.dtype):
                # DType conversion not possible
                return
            else:
                res = val
        elif isinstance(val, types.Sequence):
            if res.ndim == 1 and self.context.can_convert(val.dtype, res.dtype):
                # Allow assignement of sequence to 1d array
                res = val
            else:
                # NOTE: sequence-to-array broadcasting is unsupported
                return
        else:
            # Allow scalar broadcasting
            if self.context.can_convert(val, res.dtype):
                res = res.dtype
            else:
                # Incompatible scalar type
                return
    elif not isinstance(val, types.Array):
        # Single item assignment
        if not self.context.can_convert(val, res):
            # if the array dtype is not yet defined
            if not res.is_precise():
                # set the array type to use the dtype of value (RHS)
                newary = ary.copy(dtype=val)
                return signature(types.none, newary, idx, res)
            else:
                return
        res = val
    else:
        return
    return signature(types.none, ary, idx, res)