提交 cb2219e7 编写于 作者: N Nikolay Krasko

KT-949 AssertionFailure in quick fix

上级 c39b3336
......@@ -123,6 +123,11 @@ public class JetPsiChecker implements Annotator {
catch (ProcessCanceledException e) {
throw e;
}
catch (AssertionError e) {
// For failing tests and to notify about idea internal error in -ea mode
holder.createErrorAnnotation(element, e.getClass().getCanonicalName() + ": " + e.getMessage());
throw e;
}
catch (Throwable e) {
// TODO
holder.createErrorAnnotation(element, e.getClass().getCanonicalName() + ": " + e.getMessage());
......
......@@ -177,8 +177,7 @@ public class ImportClassFix extends JetHintAction<JetSimpleNameExpression> imple
@Nullable
@Override
public JetIntentionAction<JetSimpleNameExpression> createAction(@NotNull DiagnosticWithPsiElement diagnostic) {
assert diagnostic.getPsiElement() instanceof JetSimpleNameExpression;
// There could be different psi elements (i.e. JetArrayAccessExpression), but we can fix only JetSimpleNameExpression case
if (diagnostic.getPsiElement() instanceof JetSimpleNameExpression) {
JetSimpleNameExpression psiElement = (JetSimpleNameExpression) diagnostic.getPsiElement();
return new ImportClassFix(psiElement);
......
// "Import Class" "false"
package Teting
class Some() {
// fun get(i : Int) : Int {
// return i
// }
}
fun main(args : Array<String>) {
val some = Some()
// Nothing should be changed
<caret>some[12]
}
\ No newline at end of file
// "Import Class" "false"
package Teting
class Some() {
// fun get(i : Int) : Int {
// return i
// }
}
fun main(args : Array<String>) {
val some = Some()
// Nothing should be changed
<caret>some[12]
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册