Hindley-Milner type inference for language with implicit type casting
Hindley-Milnor type inference doesn't support implicit type casting, so you can't fix that easily.  You'd need a fundamentally different algorithm for type inference, and I'm not sure whether such a thing exists.  I think there are ways to handle type inference with implicit type casts if you don't care about supporting polymorphic types, but as far as I know, the combination of polymorphic types, type inference, recursion, and implicit type casts is hard to handle simultaneously.

In contrast, it's straightforward to extend HM type inference to handle explicit type casting.