Add method getValueParameters() to JetCallableDeclaration
This commit is contained in:
@@ -17,12 +17,18 @@
|
|||||||
package org.jetbrains.jet.lang.psi;
|
package org.jetbrains.jet.lang.psi;
|
||||||
|
|
||||||
import com.intellij.psi.PsiElement;
|
import com.intellij.psi.PsiElement;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface JetCallableDeclaration extends JetNamedDeclaration, JetTypeParameterListOwner {
|
public interface JetCallableDeclaration extends JetNamedDeclaration, JetTypeParameterListOwner {
|
||||||
@Nullable
|
@Nullable
|
||||||
JetParameterList getValueParameterList();
|
JetParameterList getValueParameterList();
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
List<JetParameter> getValueParameters();
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
JetTypeReference getReceiverTypeReference();
|
JetTypeReference getReceiverTypeReference();
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public interface JetDeclarationWithBody extends JetDeclaration {
|
|||||||
@Nullable
|
@Nullable
|
||||||
JetExpression getBodyExpression();
|
JetExpression getBodyExpression();
|
||||||
|
|
||||||
|
@Override
|
||||||
@Nullable
|
@Nullable
|
||||||
String getName();
|
String getName();
|
||||||
|
|
||||||
|
|||||||
@@ -60,6 +60,12 @@ public class JetMultiDeclarationEntry extends JetNamedDeclarationNotStubbed impl
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public List<JetParameter> getValueParameters() {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public JetTypeReference getReceiverTypeReference() {
|
public JetTypeReference getReceiverTypeReference() {
|
||||||
|
|||||||
@@ -139,6 +139,12 @@ public class JetParameter extends JetNamedDeclarationStub<KotlinParameterStub> i
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public List<JetParameter> getValueParameters() {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public JetTypeReference getReceiverTypeReference() {
|
public JetTypeReference getReceiverTypeReference() {
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
|
|||||||
import org.jetbrains.jet.lang.psi.typeRefHelpers.TypeRefHelpersPackage;
|
import org.jetbrains.jet.lang.psi.typeRefHelpers.TypeRefHelpersPackage;
|
||||||
import org.jetbrains.jet.lexer.JetTokens;
|
import org.jetbrains.jet.lexer.JetTokens;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.jetbrains.jet.JetNodeTypes.PROPERTY_DELEGATE;
|
import static org.jetbrains.jet.JetNodeTypes.PROPERTY_DELEGATE;
|
||||||
@@ -86,6 +87,12 @@ public class JetProperty extends JetTypeParameterListOwnerStub<KotlinPropertyStu
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public List<JetParameter> getValueParameters() {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
@Nullable
|
||||||
public JetTypeReference getReceiverTypeReference() {
|
public JetTypeReference getReceiverTypeReference() {
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ public class QuickFixFactoryForTypeMismatchError extends JetIntentionActionsFact
|
|||||||
if (resolvedCall != null) {
|
if (resolvedCall != null) {
|
||||||
JetFunction declaration = getFunctionDeclaration(resolvedCall);
|
JetFunction declaration = getFunctionDeclaration(resolvedCall);
|
||||||
if (declaration != null) {
|
if (declaration != null) {
|
||||||
JetParameter binaryOperatorParameter = declaration.getValueParameterList().getParameters().get(0);
|
JetParameter binaryOperatorParameter = declaration.getValueParameters().get(0);
|
||||||
actions.add(new ChangeParameterTypeFix(binaryOperatorParameter, expressionType));
|
actions.add(new ChangeParameterTypeFix(binaryOperatorParameter, expressionType));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user