Which version of torch are you using? I just tried this with torch-1.6 (the latest release) and it works:
Code
import torch

def fn() -> int:
    a = int('0')
    return a

s = torch.jit.script(fn)
print(s())

Output
0