Basic recursive generator typing error

Hello, I’m trying to jit a simple recursive generator whose type is easy to infer, but Numba fails to do so. Here’s a minimal example:

import numba

@numba.jit
def g(n):
    yield n
    if n > 0:
        for i in g(n-1):
            yield i

print(*g(5))

I get TypingError: Invalid use of getiter with parameters (none), which appears in other topics as well, but no solution works.