Implement checkcast.