Base for Algorithm W type inference.