Merge "Refactor verification of types." into main