Could I change the type of a declared variable?

You can’t change the type of a variable with a declared type, the compiler relies on knowing it’s type for it’s optimizations.