Remove ChangeType quickfix for lamdas with deprecated syntax
This commit is contained in:
@@ -78,16 +78,4 @@ public class ChangeTypeFix extends JetIntentionAction<JetTypeReference> {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static JetSingleIntentionActionFactory createFactoryForExpectedReturnTypeMismatch() {
|
||||
return new JetSingleIntentionActionFactory() {
|
||||
@Nullable
|
||||
@Override
|
||||
public IntentionAction createAction(@NotNull Diagnostic diagnostic) {
|
||||
DiagnosticWithParameters1<JetTypeReference, JetType> diagnosticWithParameters = Errors.EXPECTED_RETURN_TYPE_MISMATCH.cast(diagnostic);
|
||||
return new ChangeTypeFix(diagnosticWithParameters.getPsiElement(), diagnosticWithParameters.getA());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,7 +224,6 @@ public class QuickFixRegistrar : QuickFixContributor {
|
||||
EXPECTED_PARAMETERS_NUMBER_MISMATCH.registerFactory(ChangeFunctionSignatureFix.createFactoryForParametersNumberMismatch())
|
||||
|
||||
EXPECTED_PARAMETER_TYPE_MISMATCH.registerFactory(ChangeTypeFix.createFactoryForExpectedParameterTypeMismatch())
|
||||
EXPECTED_RETURN_TYPE_MISMATCH.registerFactory(ChangeTypeFix.createFactoryForExpectedReturnTypeMismatch())
|
||||
|
||||
val changeFunctionLiteralReturnTypeFix = ChangeFunctionLiteralReturnTypeFix.createFactoryForExpectedOrAssignmentTypeMismatch()
|
||||
EXPECTED_TYPE_MISMATCH.registerFactory(changeFunctionLiteralReturnTypeFix)
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
// "Change type from 'A' to 'B'" "true"
|
||||
interface A {}
|
||||
interface B : A {}
|
||||
|
||||
fun foo(f: (B) -> B) {
|
||||
foo {
|
||||
(b: B): A<caret> -> b
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
// "Change type from 'A' to 'B'" "true"
|
||||
interface A {}
|
||||
interface B : A {}
|
||||
|
||||
fun foo(f: (B) -> B) {
|
||||
foo {
|
||||
(b: B): B -> b
|
||||
}
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
// "Change function literal return type to 'String'" "true"
|
||||
fun foo(f: (String) -> Any) {
|
||||
foo {
|
||||
(s: String): Int ->
|
||||
s<caret>
|
||||
}
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
// "Change function literal return type to 'String'" "true"
|
||||
fun foo(f: (String) -> Any) {
|
||||
foo {
|
||||
(s: String): String ->
|
||||
s<caret>
|
||||
}
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
// "Change function literal return type to 'String'" "true"
|
||||
fun foo() {
|
||||
val f: (String) -> String = {
|
||||
(s: Any): Int ->
|
||||
""<caret>
|
||||
}
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
// "Change function literal return type to 'String'" "true"
|
||||
fun foo() {
|
||||
val f: (String) -> String = {
|
||||
(s: Any): String ->
|
||||
""<caret>
|
||||
}
|
||||
}
|
||||
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
// "Change 'bar' type to '(() -> Long) -> Unit'" "true"
|
||||
fun foo() {
|
||||
val bar: () -> Double = {
|
||||
(f: () -> Long): String ->
|
||||
var x = 5<caret>
|
||||
}
|
||||
}
|
||||
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
// "Change 'bar' type to '(() -> Long) -> Unit'" "true"
|
||||
fun foo() {
|
||||
val bar: (() -> Long) -> Unit = {
|
||||
(f: () -> Long): Unit ->
|
||||
var x = 5<caret>
|
||||
}
|
||||
}
|
||||
@@ -5973,12 +5973,6 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("expectedReturnTypeMismatch.kt")
|
||||
public void testExpectedReturnTypeMismatch() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/typeMismatch/expectedReturnTypeMismatch.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("hasNextFunctionReturnTypeMismatch.kt")
|
||||
public void testHasNextFunctionReturnTypeMismatch() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/typeMismatch/hasNextFunctionReturnTypeMismatch.kt");
|
||||
@@ -6251,18 +6245,6 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("changeFunctionLiteralTypeWithoutChangingFunctionParameterType.kt")
|
||||
public void testChangeFunctionLiteralTypeWithoutChangingFunctionParameterType() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/changeFunctionLiteralTypeWithoutChangingFunctionParameterType.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("changeFunctionLiteralTypeWithoutChangingPropertyType.kt")
|
||||
public void testChangeFunctionLiteralTypeWithoutChangingPropertyType() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/changeFunctionLiteralTypeWithoutChangingPropertyType.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("changeFunctionReturnTypeToFunctionType.kt")
|
||||
public void testChangeFunctionReturnTypeToFunctionType() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/changeFunctionReturnTypeToFunctionType.kt");
|
||||
@@ -6281,12 +6263,6 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("expectedTypeMismatch.kt")
|
||||
public void testExpectedTypeMismatch() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/expectedTypeMismatch.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("multiFakeOverride.kt")
|
||||
public void testMultiFakeOverride() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/multiFakeOverride.kt");
|
||||
|
||||
Reference in New Issue
Block a user