Add debug strings to frontend scopes-related structures
Such as: - PackageFragmentProviders, and, in particular, CompositePackageFragmentProviders - JavaPackageFragments - Scopes produced by those providers The rationale is that a lot of frontend-facing bugs (like red code) are easily recognizeable in resolution. But at that point you just see a bunch of scopes, without meaningful toStrings, you don't know who has produced them, and what's exactly wrong. With this commit it should make debugging slightly easier: now at least you'll be able to see that "this scope is a scope of package fragment for foo.bar of module baz" and decide whether the declaration should or should not have been resolved from such scope.
This commit is contained in:
committed by
teamcityserver
parent
a51c65ed60
commit
708fead1cc
+3
-4
@@ -94,10 +94,9 @@ abstract class KlibMetadataPackageFragment(
|
||||
nameResolver,
|
||||
KlibMetadataVersion.INSTANCE,
|
||||
/* containerSource = */ null,
|
||||
components
|
||||
) {
|
||||
loadClassNames()
|
||||
}
|
||||
components,
|
||||
"scope for $this"
|
||||
) { loadClassNames() }
|
||||
}
|
||||
|
||||
override fun getMemberScope(): DeserializedPackageMemberScope = _memberScope
|
||||
|
||||
+4
-1
@@ -183,7 +183,10 @@ class KlibMetadataModuleDescriptorFactoryImpl(
|
||||
}
|
||||
|
||||
return compositePackageFragmentAddend?.let {
|
||||
CompositePackageFragmentProvider(listOf(it, provider))
|
||||
CompositePackageFragmentProvider(
|
||||
listOf(it, provider),
|
||||
"CompositeProvider@KlibMetadataModuleDescriptorFactory for $moduleDescriptor"
|
||||
)
|
||||
} ?: provider
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user