Finished type safety proof for reference semantics.