Statically resolve variable references