Is it legal in Illinois for an officer who sees you at a bar to wait for you to leave and pull you over?

There is nothing to prevent it. Why would it be illegal for him to see you at a bar and pull you over?