Hello. I know it’s an old post but I ran into the same problem today and in my case Live Coding was enabled in Editor Preferences → Live Conding and I was trying to compile my code. Disabling LiveCoding everything went back to normal.
Hope it helps someone.