Drop everything related to lambda syntax deprecation

This commit is contained in:
Denis Zharkov
2015-09-23 20:10:35 +03:00
parent 73799e2c3c
commit c6377a0664
35 changed files with 0 additions and 502 deletions
@@ -364,9 +364,6 @@ public interface Errors {
DiagnosticFactory0<JetParameter> USELESS_VARARG_ON_PARAMETER = DiagnosticFactory0.create(WARNING);
DiagnosticFactory0<JetFunctionLiteralExpression> DEPRECATED_LAMBDA_SYNTAX =
DiagnosticFactory0.create(WARNING, FUNCTION_LITERAL_EXPRESSION_DECLARATION);
// Named parameters
DiagnosticFactory0<JetParameter> DEFAULT_VALUE_NOT_ALLOWED_IN_OVERRIDE = DiagnosticFactory0.create(ERROR, PARAMETER_DEFAULT_VALUE);
@@ -178,12 +178,6 @@ public object PositioningStrategies {
}
}
public val FUNCTION_LITERAL_EXPRESSION_DECLARATION: PositioningStrategy<JetFunctionLiteralExpression>
= object : PositioningStrategy<JetFunctionLiteralExpression>() {
override fun mark(element: JetFunctionLiteralExpression) = DECLARATION_SIGNATURE_OR_DEFAULT.mark(element.getFunctionLiteral())
override fun isValid(element: JetFunctionLiteralExpression) = DECLARATION_SIGNATURE_OR_DEFAULT.isValid(element.getFunctionLiteral())
}
public val TYPE_PARAMETERS_OR_DECLARATION_SIGNATURE: PositioningStrategy<JetDeclaration> = object : PositioningStrategy<JetDeclaration>() {
override fun mark(element: JetDeclaration): List<TextRange> {
if (element is JetTypeParameterListOwner) {
@@ -226,8 +226,6 @@ public class DefaultErrorMessages {
MAP.put(FUNCTION_EXPRESSION_PARAMETER_WITH_DEFAULT_VALUE, "A function expression is not allowed to specify default values for its parameters");
MAP.put(USELESS_VARARG_ON_PARAMETER, "Vararg on this parameter is useless");
MAP.put(DEPRECATED_LAMBDA_SYNTAX,
"This syntax for lambda is deprecated. Use short lambda notation {a[: Int], b[: String] -> ...} or function expression instead.");
MAP.put(PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT, "Projections are not allowed on type arguments of functions and properties");
MAP.put(SUPERTYPE_NOT_INITIALIZED, "This type has a constructor, and thus must be initialized here");
@@ -63,14 +63,4 @@ public class JetParameterList extends JetElementImplStub<KotlinPlaceHolderStub<J
public void removeParameter(@NotNull JetParameter parameter) {
EditCommaSeparatedListHelper.INSTANCE$.removeItem(parameter);
}
// this method needed only for migrate lambda syntax
@Deprecated
public boolean isParenthesized() {
PsiElement firstChild = getFirstChild();
if (firstChild != null && firstChild.getNode() != null) {
return firstChild.getNode().getElementType() == JetTokens.LPAR;
}
return false;
}
}
@@ -884,16 +884,6 @@ public class JetPsiUtil {
return null;
}
public static boolean isDeprecatedLambdaSyntax(@NotNull JetFunctionLiteralExpression functionLiteralExpression) {
JetFunctionLiteral functionLiteral = functionLiteralExpression.getFunctionLiteral();
if (functionLiteral.hasDeclaredReturnType() || functionLiteral.getReceiverTypeReference() != null) return true;
JetParameterList valueParameterList = functionLiteral.getValueParameterList();
if (valueParameterList != null && valueParameterList.isParenthesized()) return true;
return false;
}
@Nullable
public static JetExpression getLastElementDeparenthesized(
@Nullable JetExpression expression,
@@ -136,10 +136,6 @@ public class FunctionsTypingVisitor(facade: ExpressionTypingInternals) : Express
override fun visitFunctionLiteralExpression(expression: JetFunctionLiteralExpression, context: ExpressionTypingContext): JetTypeInfo? {
if (!expression.getFunctionLiteral().hasBody()) return null
if (JetPsiUtil.isDeprecatedLambdaSyntax(expression)) {
context.trace.report(DEPRECATED_LAMBDA_SYNTAX.on(expression))
}
val expectedType = context.expectedType
val functionTypeExpected = !noExpectedType(expectedType) && KotlinBuiltIns.isFunctionOrExtensionFunctionType(expectedType)