'Test error due mishandling of Optional to Optional casting
Related issue: https://github.com/numba/numba/issues/1718'

def test_optional_to_optional(self):

    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))
