That is exactly the behavior I expected and did not get. After running the project in Preview once, trying to change the import and event sheet gives an error:
Or, going the other direction:
Changing to import * as Main
first, running in Preview once, and then using Undo to go back to import {GetMessage}
and running in Preview again works fine. I can Undo/Redo back and forth and it will run, but changing it back by typing it out breaks it again.
I guess this is a bug then. I'll submit a bug report when I get a chance.