Don't throw exception on recursion for class header scope
The root issue here is that when we have some cycle in scopes, the place where we detect a loop depends on where we've entered that cycle. Previously, we didn't know about cases where we enter scopes loop through `ClassResolutionScopesSupport.scopeForClassHeaderResolution` => there were no need to handle recursion on `scopeForClassHeaderResolution` carefully. It seems that in some very narrow cases (launch of specific inspection on specficic code with specific caches state), we do manage to enter loop exactly through `scopeForClassHeaderResolution` (see KT-23033), which causes exception. ^KT-23033 Fixed
This commit is contained in:
+1
-1
@@ -40,7 +40,7 @@ class ClassResolutionScopesSupport(
|
||||
}
|
||||
}
|
||||
|
||||
val scopeForClassHeaderResolution: () -> LexicalScope = storageManager.createLazyValue {
|
||||
val scopeForClassHeaderResolution: () -> LexicalScope = storageManager.createLazyValue(onRecursion = createErrorLexicalScope) {
|
||||
scopeWithGenerics(getOuterScope())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user