# Buggy code
def stage_preserve_ir(self):
    self.func_ir_original = self.func_ir.copy()


# 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_preserve_ir(self):
    self.func_ir_original = copy.deepcopy(self.func_ir)