Moved type transformation logic out of annotate-classes back into prims.