improve type constraint resolution