Do not weakly retain caches whose computation has side-effects

Lazy scopes write REFERENCE_TARGET to trace as a side-effect, when weak caches are cleared, resolution may be repeated, and a rewrite error happens
This commit is contained in:
Andrey Breslav
2014-02-26 21:03:31 +04:00
parent 4b50262ed6
commit ac8b12baf1
@@ -47,7 +47,7 @@ public class ScopeProvider {
public ScopeProvider(@NotNull ResolveSession resolveSession) {
this.resolveSession = resolveSession;
this.fileScopes = resolveSession.getStorageManager().createWeaklyRetainedMemoizedFunction(new Function1<JetFile, JetScope>() {
this.fileScopes = resolveSession.getStorageManager().createMemoizedFunction(new Function1<JetFile, JetScope>() {
@Override
public JetScope invoke(@NotNull JetFile file) {
return createFileScope(file);