Fixed failed assertions on navigating to 'Assertions' class of Kotlin runtime
This commit is contained in:
@@ -21,10 +21,7 @@ import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.impl.compiled.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.psi.JetClass;
|
||||
import org.jetbrains.jet.lang.psi.JetDeclaration;
|
||||
import org.jetbrains.jet.lang.psi.JetFunction;
|
||||
import org.jetbrains.jet.lang.psi.JetProperty;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
|
||||
/**
|
||||
* @author Evgeny Gerashchenko
|
||||
@@ -39,7 +36,7 @@ public class JetClsNavigationPolicy implements ClsCustomNavigationPolicy {
|
||||
}
|
||||
JetClass jetClass = (JetClass) getJetDeclarationByClsElement(clsClass);
|
||||
if (jetClass != null) {
|
||||
JetClass sourceClass = JetSourceNavigationHelper.getSourceClass(jetClass);
|
||||
JetClassOrObject sourceClass = JetSourceNavigationHelper.getSourceClass(jetClass);
|
||||
if (sourceClass != null) {
|
||||
return sourceClass;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ public class JetSourceNavigationHelper {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static JetClass getSourceClass(@NotNull JetClass decompiledClass) {
|
||||
public static JetClassOrObject getSourceClass(@NotNull JetClass decompiledClass) {
|
||||
Tuple2<BindingContext, ClassDescriptor> bindingContextAndClassDescriptor = getBindingContextAndClassDescriptor(decompiledClass);
|
||||
if (bindingContextAndClassDescriptor == null) return null;
|
||||
PsiElement declaration = BindingContextUtils.classDescriptorToDeclaration(
|
||||
@@ -101,7 +101,7 @@ public class JetSourceNavigationHelper {
|
||||
if (declaration == null) {
|
||||
throw new IllegalStateException("class not found by " + bindingContextAndClassDescriptor._2);
|
||||
}
|
||||
return (JetClass) declaration;
|
||||
return (JetClassOrObject) declaration;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user