function invocation with only type parameters prohibited
This commit is contained in:
@@ -22,17 +22,16 @@ import com.intellij.psi.PsiFile;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.diagnostics.Diagnostic;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
import org.jetbrains.jet.lang.psi.JetExpression;
|
||||
import org.jetbrains.jet.lang.psi.JetPsiFactory;
|
||||
import org.jetbrains.jet.plugin.JetBundle;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author svtk
|
||||
*/
|
||||
public class ChangeToFunctionInvocationFix extends JetIntentionAction<JetReferenceExpression> {
|
||||
public class ChangeToFunctionInvocationFix extends JetIntentionAction<JetExpression> {
|
||||
|
||||
public ChangeToFunctionInvocationFix(@NotNull JetReferenceExpression element) {
|
||||
public ChangeToFunctionInvocationFix(@NotNull JetExpression element) {
|
||||
super(element);
|
||||
}
|
||||
|
||||
@@ -50,16 +49,16 @@ public class ChangeToFunctionInvocationFix extends JetIntentionAction<JetReferen
|
||||
|
||||
@Override
|
||||
public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
|
||||
JetReferenceExpression reference = (JetReferenceExpression) element.copy();
|
||||
JetExpression reference = (JetExpression) element.copy();
|
||||
element.replace(JetPsiFactory.createExpression(project, reference.getText() + "()"));
|
||||
}
|
||||
|
||||
public static JetIntentionActionFactory createFactory() {
|
||||
return new JetIntentionActionFactory() {
|
||||
@Override
|
||||
public JetIntentionAction<JetReferenceExpression> createAction(Diagnostic diagnostic) {
|
||||
if (diagnostic.getPsiElement() instanceof JetReferenceExpression) {
|
||||
return new ChangeToFunctionInvocationFix((JetReferenceExpression) diagnostic.getPsiElement());
|
||||
public JetIntentionAction<JetExpression> createAction(Diagnostic diagnostic) {
|
||||
if (diagnostic.getPsiElement() instanceof JetExpression) {
|
||||
return new ChangeToFunctionInvocationFix((JetExpression) diagnostic.getPsiElement());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,6 @@
|
||||
|
||||
class X<A, B : A>()
|
||||
|
||||
val b = X<Any, X<A<C>, C>>
|
||||
val b0 = X<Any, <error>Any?</error>>
|
||||
val b1 = X<Any, X<A<C>, <error>String</error>>>
|
||||
val b = X<Any, X<A<C>, C>>()
|
||||
val b0 = X<Any, <error>Any?</error>>()
|
||||
val b1 = X<Any, X<A<C>, <error>String</error>>>()
|
||||
|
||||
@@ -16,8 +16,8 @@ fun test(<warning>l</warning> : java.util.List<Int>) {
|
||||
|
||||
val <warning>f</warning> : java.io.File? = null
|
||||
|
||||
Collections.<error>emptyList</error>
|
||||
Collections.emptyList<Int>
|
||||
Collections.<error><error>emptyList</error></error>
|
||||
Collections.<error>emptyList<Int></error>
|
||||
Collections.emptyList<Int>()
|
||||
Collections.<error>emptyList()</error>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ abstract class Item(val room: Object) {
|
||||
abstract val name : String
|
||||
}
|
||||
|
||||
val items: ArrayList<Item> = ArrayList<Item>
|
||||
val items: ArrayList<Item> = ArrayList<Item>()
|
||||
|
||||
fun test(room : Object) {
|
||||
for(val item: Item in items) {
|
||||
|
||||
Reference in New Issue
Block a user