Add method getValueParameters() to JetCallableDeclaration

This commit is contained in:
Stanislav Erokhin
2014-11-28 14:40:14 +03:00
parent a5c0dda10f
commit 9ed37ca1eb
6 changed files with 27 additions and 1 deletions
@@ -17,12 +17,18 @@
package org.jetbrains.jet.lang.psi;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
public interface JetCallableDeclaration extends JetNamedDeclaration, JetTypeParameterListOwner {
@Nullable
JetParameterList getValueParameterList();
@NotNull
List<JetParameter> getValueParameters();
@Nullable
JetTypeReference getReceiverTypeReference();
@@ -26,6 +26,7 @@ public interface JetDeclarationWithBody extends JetDeclaration {
@Nullable
JetExpression getBodyExpression();
@Override
@Nullable
String getName();
@@ -60,6 +60,12 @@ public class JetMultiDeclarationEntry extends JetNamedDeclarationNotStubbed impl
return null;
}
@NotNull
@Override
public List<JetParameter> getValueParameters() {
return Collections.emptyList();
}
@Nullable
@Override
public JetTypeReference getReceiverTypeReference() {
@@ -139,6 +139,12 @@ public class JetParameter extends JetNamedDeclarationStub<KotlinParameterStub> i
return null;
}
@NotNull
@Override
public List<JetParameter> getValueParameters() {
return Collections.emptyList();
}
@Nullable
@Override
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.lexer.JetTokens;
import java.util.Collections;
import java.util.List;
import static org.jetbrains.jet.JetNodeTypes.PROPERTY_DELEGATE;
@@ -86,6 +87,12 @@ public class JetProperty extends JetTypeParameterListOwnerStub<KotlinPropertyStu
return null;
}
@NotNull
@Override
public List<JetParameter> getValueParameters() {
return Collections.emptyList();
}
@Override
@Nullable
public JetTypeReference getReceiverTypeReference() {
@@ -86,7 +86,7 @@ public class QuickFixFactoryForTypeMismatchError extends JetIntentionActionsFact
if (resolvedCall != null) {
JetFunction declaration = getFunctionDeclaration(resolvedCall);
if (declaration != null) {
JetParameter binaryOperatorParameter = declaration.getValueParameterList().getParameters().get(0);
JetParameter binaryOperatorParameter = declaration.getValueParameters().get(0);
actions.add(new ChangeParameterTypeFix(binaryOperatorParameter, expressionType));
}
}