I don't think the semantics of the language should depend on compiler switches. But this problem has bitten me too, with the added quirk that the framework I used didn't even give a startup error .... it just failed to create database transactions, causing writes to be silently discarded! I lost several days debugging that one.
A better solution might be an IDE warning where if it detects you’re using some kind of class enhancer framework or a class that contains some kind of injection annotation, it can highlight the class definition in yellow if it’s not open.
Or yeah, just invert the default for everyone. I suspect it’ll cause more pain than it’s worth.