Idea 2020.1 can not see project classes


The issue happens to me after I updated to Idea 2020.1 EAP.

Sometimes after I switch between branches with different dependencies (maven project),
Idea editor shows some project classes references as red as they are not found
though both `mvn compile` and `build project` (Ctlr+F9) button works perfectly.

The issue goes away if I "Restart and invalidate caches".


Here is a related issue on YouTrack:

Feel free to watch it in order to be notified once it has updates. See [this article]( if you are not familiar with YouTrack.