Type checking local assignment