Fixing type infer in variabledeclarationstatements

Had to do it from the statement instead of the initializer of the
variable.