

def test_optional_to_optional(self):
    '\n        Test error due mishandling of Optional to Optional casting\n\n        Related issue: https://github.com/numba/numba/issues/1718\n        '
    opt_int = types.Optional(types.intp)
    opt_flt = types.Optional(types.float64)
    sig = opt_flt(opt_int)

    @njit(sig)
    def foo(a):
        return a
    self.assertEqual(foo(2), 2)
    self.assertIsNone(foo(None))

dataset/ETHPy150Open numba/numba/numba/tests/test_casting.py TestCasting.test_optional_to_optional/original