# Buggy code
def __init__(self, context, func_ir, warnings):
    self.context = context
    self.blocks = func_ir.blocks
    self.generator_info = func_ir.generator_info
    self.func_id = func_ir.func_id
    self.func_ir = func_ir

    self.typevars = TypeVarMap()
    self.typevars.set_context(context)
    self.constraints = ConstraintNetwork()
    self.warnings = warnings

    # { index: mangled name }
    self.arg_names = {}
    # self.return_type = None
    # Set of assumed immutable globals
    self.assumed_immutables = set()
    # Track all calls and associated constraints
    self.calls = []
    # The inference result of the above calls
    self.calltypes = utils.UniqueDict()
    # Target var -> constraint with refine hook
    self.refine_map = {}

    if config.DEBUG or config.DEBUG_TYPEINFER:
        self.debug = TypeInferDebug(self)
    else:
        self.debug = NullDebug()

    self._skip_recursion = False


# 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 __init__(self, context, func_ir, warnings):
    self.context = context
    # sort based on label, ensure iteration order!
    self.blocks = OrderedDict()
    for k in sorted(func_ir.blocks.keys()):
        self.blocks[k] = func_ir.blocks[k]
    self.generator_info = func_ir.generator_info
    self.func_id = func_ir.func_id
    self.func_ir = func_ir

    self.typevars = TypeVarMap()
    self.typevars.set_context(context)
    self.constraints = ConstraintNetwork()
    self.warnings = warnings

    # { index: mangled name }
    self.arg_names = {}
    # self.return_type = None
    # Set of assumed immutable globals
    self.assumed_immutables = set()
    # Track all calls and associated constraints
    self.calls = []
    # The inference result of the above calls
    self.calltypes = utils.UniqueDict()
    # Target var -> constraint with refine hook
    self.refine_map = {}

    if config.DEBUG or config.DEBUG_TYPEINFER:
        self.debug = TypeInferDebug(self)
    else:
        self.debug = NullDebug()

    self._skip_recursion = False