Fix DescriptorUtils#getContainingModule
This commit is contained in:
@@ -153,6 +153,9 @@ public class DescriptorUtils {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static ModuleDescriptor getContainingModule(@NotNull DeclarationDescriptor descriptor) {
|
public static ModuleDescriptor getContainingModule(@NotNull DeclarationDescriptor descriptor) {
|
||||||
|
if (descriptor instanceof PackageViewDescriptor) {
|
||||||
|
return ((PackageViewDescriptor) descriptor).getModule();
|
||||||
|
}
|
||||||
ModuleDescriptor module = getParentOfType(descriptor, ModuleDescriptor.class, false);
|
ModuleDescriptor module = getParentOfType(descriptor, ModuleDescriptor.class, false);
|
||||||
assert module != null : "Descriptor without a containing module: " + descriptor;
|
assert module != null : "Descriptor without a containing module: " + descriptor;
|
||||||
return module;
|
return module;
|
||||||
|
|||||||
Reference in New Issue
Block a user