First, I would likely not tell my child 'not' to play with 'that child'.
That said, I would caution my child on *how* he plays with another child if I saw that other child doing unsafe things or getting other kids into trouble.
For instance, if little Bobby is always getting my son's attention so that he's distracted at school, I'd remind my son of his classroom rules. "When Bobby is making you laugh, is he helping you to learn? Is he letting the teacher teach?" and then "Next time, you can tell Bobby 'I'll play with you at recess, but right now I have to listen to teacher'."
If Bobby is hitting, then that's something to talk about. "I notice that Bobby hits other kids. Do you think they like that?"
"If you see Bobby being unsafe with his body, it's a good idea to go and do something else. Even if Bobby is acting like it's fun, it's not fun for the other kids, and you know you need to be safe for other people's bodies. There are other kids who can play in a friendly way."
My son is in kindergarten, by the way. The only time I would really go out of my way to even address something like this is if the teacher brought it to my attention that my child and that other child were being in an unsafe or disruptive manner. If my child were the one causing problems, I'd want to know. I think it's really important to label the actions (unsafe, not helpful, etc.) without labeling the kid. These children will be in each other's classrooms for years, and I would personally NOT want to be the mom of the kid that's labelled 'bad'.... I imagine that I should treat any other mom's kid with that save respect. Lots of kids go through hard phases during their school years. Phases can last a few weeks or month, or even a year or two. At my son's school, we're all together from k-8 as parents, so we're going to be seeing a lot of each other. :)