# Buggy code
def stage_inline_pass(self):
    """
    Inline calls to locally defined closures.
    """
    # Ensure we have an IR and type information.
    assert self.func_ir
    inline_pass = InlineClosureCallPass(
        self.func_ir, self.flags.auto_parallel, self.parfor_diagnostics.replaced_fns
    )
    inline_pass.run()
    # Remove all Dels, and re-run postproc
    post_proc = postproc.PostProcessor(self.func_ir)
    post_proc.run()

    if config.DEBUG or config.DUMP_IR:
        name = self.func_ir.func_id.func_qualname
        print(("IR DUMP: %s" % name).center(80, "-"))
        self.func_ir.dump()


# Traceback (AssertionError)
Traceback (most recent call last):
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\errors.py", line 617, in new_error_context
yield
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\lowering.py", line 259, in lower_block
self.lower_inst(inst)
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\pylowering.py", line 96, in lower_inst
value = self.lower_assign(inst)
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\pylowering.py", line 186, in lower_assign
val = self.loadvar(value.name)
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\pylowering.py", line 555, in loadvar
assert name in self._live_vars, name
AssertionError: array.22

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/yukoba/.IntelliJIdea2018.3/config/scratches/scratch_6.py", line 10, in <module>
print(main())
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\dispatcher.py", line 367, in _compile_for_args
raise e
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\dispatcher.py", line 324, in _compile_for_args
return self.compile(tuple(argtypes))
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock
return func(*args, **kwargs)
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\dispatcher.py", line 655, in compile
cres = self._compiler.compile(args, return_type)
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\dispatcher.py", line 82, in compile
pipeline_class=self.pipeline_class)
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\compiler.py", line 926, in compile_extra
return pipeline.compile_extra(func)
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\compiler.py", line 374, in compile_extra
return self._compile_bytecode()
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\compiler.py", line 857, in _compile_bytecode
return self._compile_core()
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\compiler.py", line 844, in _compile_core
res = pm.run(self.status)
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock
return func(*args, **kwargs)
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\compiler.py", line 255, in run
raise patched_exception
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\compiler.py", line 246, in run
stage()
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\compiler.py", line 691, in stage_objectmode_backend
self._backend(lowerfn, objectmode=True)
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\compiler.py", line 666, in _backend
lowered = lowerfn()
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\compiler.py", line 638, in backend_object_mode
self.flags)
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\compiler.py", line 1075, in py_lowering_stage
lower.lower()
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\lowering.py", line 178, in lower
self.lower_normal_function(self.fndesc)
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\lowering.py", line 219, in lower_normal_function
entry_block_tail = self.lower_function_body()
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\lowering.py", line 244, in lower_function_body
self.lower_block(block)
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\lowering.py", line 259, in lower_block
self.lower_inst(inst)
File "C:\Users\yukoba\Anaconda3\lib\contextlib.py", line 130, in __exit__
self.gen.throw(type, value, traceback)
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\errors.py", line 625, in new_error_context
six.reraise(type(newerr), newerr, tb)
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\six.py", line 659, in reraise
raise value
numba.errors.LoweringError: Failed in object mode pipeline (step: object mode backend)
array.22

File "scratch_6.py", line 7:
def main():
<source elided>
a = np.array(((1, 2), (3, 4)))
return np.array([x for x in a])
^

[1] During: lowering "$0.13 = array.22" at C:/Users/yukoba/.IntelliJIdea2018.3/config/scratches/scratch_6.py (7)

# Fixed code
def stage_inline_pass(self):
    """
    Inline calls to locally defined closures.
    """
    # Ensure we have an IR and type information.
    assert self.func_ir

    # if the return type is a pyobject, there's no type info available and
    # no ability to resolve certain typed function calls in the array
    # inlining code, use this variable to indicate
    typed_pass = not isinstance(self.return_type, types.misc.PyObject)
    inline_pass = InlineClosureCallPass(
        self.func_ir,
        self.flags.auto_parallel,
        self.parfor_diagnostics.replaced_fns,
        typed_pass,
    )
    inline_pass.run()
    # Remove all Dels, and re-run postproc
    post_proc = postproc.PostProcessor(self.func_ir)
    post_proc.run()

    if config.DEBUG or config.DUMP_IR:
        name = self.func_ir.func_id.func_qualname
        print(("IR DUMP: %s" % name).center(80, "-"))
        self.func_ir.dump()