Implement impl and trait merging.