This code compiles and runs, even though the type annotation on the mandatory parameter x is wrong:
def g(x:int, y=0)->int:
return x[y]
g([3])
If you remove the optional argument y, retic raises a static type error (good!):
def g(x:int)->int:
y = 0
return x[y]
# Cannot index into a value of type Int
Tested on the master branch, 7adef84