Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import de.peeeq.wurstio.WurstCompilerJassImpl;
import de.peeeq.wurstio.utils.FileUtils;
import de.peeeq.wurstscript.RunArgs;
import de.peeeq.wurstscript.SyntacticSugar;
import de.peeeq.wurstscript.WLogger;
import de.peeeq.wurstscript.ast.*;
import de.peeeq.wurstscript.attributes.CompileError;
Expand Down Expand Up @@ -97,6 +98,7 @@ public Changes removeCompilationUnit(WFile resource) {
}
}
GlobalCaches.clearLookupCacheFor(toRemove);
toRemove.forEach(SyntacticSugar::restoreDirectFieldIterations);
model2.removeAll(toRemove);
}

Expand Down Expand Up @@ -267,6 +269,7 @@ private void clearCompilationUnits(Collection<CompilationUnit> toCheck) {
}

private void clearCompilationUnit(CompilationUnit cu) {
SyntacticSugar.restoreDirectFieldIterations(cu);
cu.clearAttributes();
// clear module instantiations
for (WPackage p : cu.getPackages()) {
Expand Down
Loading
Loading