finish type-checking prims