FIR: fix use-site file in supertypes resolution
manifested in the IC tests by a seemingly redundant lookup, although theoretically may lead to more severe issues. Also fixes lookup recording ignoring logic, since the old one may break with the new us-site file calculation. #KT-55195 fixed
This commit is contained in:
committed by
Space Team
parent
dcbcc8b684
commit
62f2a09d70
+4
-3
@@ -24,9 +24,10 @@ class IncrementalPassThroughLookupTrackerComponent(
|
||||
private val sourceToFilePathsCache = ConcurrentHashMap<KtSourceElement, String>()
|
||||
|
||||
override fun recordLookup(name: Name, inScopes: List<String>, source: KtSourceElement?, fileSource: KtSourceElement?) {
|
||||
assert(fileSource != null || source is KtPsiSourceElement) // finding file for a source only possible for PSI, here it means
|
||||
// that we allow null for file source only for PSI-only "sources", currently - java ones
|
||||
val definedSource = fileSource ?: source ?: throw AssertionError("Cannot record lookup for \"$name\" without a source")
|
||||
// finding file for a source only possible for PSI, here it means
|
||||
// that we allow null for file source only for PSI-only "sources", currently - java ones, ignoring the other cases
|
||||
// TODO: although there are valid use cases for missing fileSource, the ignore may hide some possible bugs; consider stricter implementation
|
||||
val definedSource = fileSource ?: (source as? KtPsiSourceElement) ?: return
|
||||
val path = sourceToFilePathsCache.getOrPut(definedSource) {
|
||||
sourceToFilePath(definedSource) ?:
|
||||
// TODO: the lookup by non-file source mostly doesn't work for the LT, so we cannot afford null file sources here
|
||||
|
||||
Reference in New Issue
Block a user