Type inference use the default value of argument not work?

Hi, maybe you are right, but, a bit chaos here. as a not a newbie user of Crystal, I messed it up again, just because i remember part of the asterite said word, but I forgot he was talking about ivar.

I consider if there never give a default value, as you said, it makes sense it’s allowed to accept any value, but, if give a default value to it, why we can’t guess the type of it from this value? this seems like the best result i can figure out, unless there’s a reason can’t do like this.

x = 1
p typeof(x)
x = "hello"

Why above code we can safely assume the type of x is a Int32?