Retain original type when variable is reassigned