Fix wrong assertion in KotlinSignature line markers
Since "memberScope" comes from JavaDescriptorResolver and the latter can return Kotlin descriptors (built-in or deserialized from another module), "container" must not always be JavaClassDescriptor. This assertion was reproducible on Kotlin project by opening "IntProgression" class from runtime module
This commit is contained in:
+3
-1
@@ -201,7 +201,9 @@ public class KotlinSignatureInJavaMarkerProvider implements LineMarkerProvider {
|
|||||||
if (member instanceof PsiMethod) {
|
if (member instanceof PsiMethod) {
|
||||||
if (((PsiMethod) member).isConstructor()) {
|
if (((PsiMethod) member).isConstructor()) {
|
||||||
DeclarationDescriptor container = memberScope.getContainingDeclaration();
|
DeclarationDescriptor container = memberScope.getContainingDeclaration();
|
||||||
assert container instanceof JavaClassDescriptor : container + "\n" + memberScope;
|
if (!(container instanceof JavaClassDescriptor)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
((JavaClassDescriptor) container).getConstructors();
|
((JavaClassDescriptor) container).getConstructors();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user