[Kotlin] Add tests for the problematic cases leading to an exception

...about incorrect number of type args.

^KT-65803 Fixed

GitOrigin-RevId: 4aa22b56320433a1f331a3a272a17a138e7de933
This commit is contained in:
Roman Efremov
2024-08-02 11:42:34 +00:00
committed by intellij-monorepo-bot
parent 10ac1f2a4e
commit 01ff89641b
10 changed files with 88 additions and 0 deletions
@@ -3477,6 +3477,11 @@ public abstract class K2IntentionTestGenerated extends AbstractK2IntentionTest {
runTest("../../../idea/tests/testData/intentions/convertReferenceToLambda/member.kt");
}
@TestMetadata("missingTypeArgument.kt")
public void testMissingTypeArgument() throws Exception {
runTest("../../../idea/tests/testData/intentions/convertReferenceToLambda/missingTypeArgument.kt");
}
@TestMetadata("multipleLambdaArgumentsAreNotMovedOutsideParentheses.kt")
public void testMultipleLambdaArgumentsAreNotMovedOutsideParentheses() throws Exception {
runTest("../../../idea/tests/testData/intentions/convertReferenceToLambda/multipleLambdaArgumentsAreNotMovedOutsideParentheses.kt");
@@ -8318,6 +8318,11 @@ public abstract class K1IntentionTestGenerated extends AbstractK1IntentionTest {
runTest("testData/intentions/convertReferenceToLambda/member.kt");
}
@TestMetadata("missingTypeArgument.kt")
public void testMissingTypeArgument() throws Exception {
runTest("testData/intentions/convertReferenceToLambda/missingTypeArgument.kt");
}
@TestMetadata("multipleLambdaArgumentsAreNotMovedOutsideParentheses.kt")
public void testMultipleLambdaArgumentsAreNotMovedOutsideParentheses() throws Exception {
runTest("testData/intentions/convertReferenceToLambda/multipleLambdaArgumentsAreNotMovedOutsideParentheses.kt");
@@ -5604,6 +5604,16 @@ public abstract class K1QuickFixTestGenerated extends AbstractK1QuickFixTest {
runTest("testData/quickfix/createFromUsage/createFunction/call/member/funWithNullableTypeParameter.kt");
}
@TestMetadata("implicitThisInLocalClassWithTypeParameterFromExtensionParent.kt")
public void testImplicitThisInLocalClassWithTypeParameterFromExtensionParent() throws Exception {
runTest("testData/quickfix/createFromUsage/createFunction/call/member/implicitThisInLocalClassWithTypeParameterFromExtensionParent.kt");
}
@TestMetadata("implicitThisInNestedClassWithTypeParameterFromParent.kt")
public void testImplicitThisInNestedClassWithTypeParameterFromParent() throws Exception {
runTest("testData/quickfix/createFromUsage/createFunction/call/member/implicitThisInNestedClassWithTypeParameterFromParent.kt");
}
@TestMetadata("inconsistentTypes.kt")
public void testInconsistentTypes() throws Exception {
runTest("testData/quickfix/createFromUsage/createFunction/call/member/inconsistentTypes.kt");
@@ -0,0 +1,4 @@
// SKIP_ERRORS_BEFORE
class Test<T>
val x = Test::<caret>toString
@@ -0,0 +1,4 @@
// SKIP_ERRORS_BEFORE
class Test<T>
val x = { test: Test<*> -> test.toString() }
@@ -0,0 +1,4 @@
// SKIP_ERRORS_BEFORE
class Test<T>
val x = { test: Test -> test.toString() }
@@ -0,0 +1,11 @@
// "Create function 'foo'" "true"
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.createFromUsage.createCallable.CreateCallableFromUsageFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.k2.codeinsight.quickFixes.createFromUsage.CreateKotlinCallableAction
fun <T> T.ext() {
class Local {
fun test() {
f<caret>oo()
}
}
}
@@ -0,0 +1,15 @@
// "Create function 'foo'" "true"
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.createFromUsage.createCallable.CreateCallableFromUsageFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.k2.codeinsight.quickFixes.createFromUsage.CreateKotlinCallableAction
fun <T> T.ext() {
class Local {
fun test() {
foo()
}
private fun foo() {
TODO("Not yet implemented")
}
}
}
@@ -0,0 +1,13 @@
// "Create function 'foo'" "true"
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.createFromUsage.createCallable.CreateCallableFromUsageFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.k2.codeinsight.quickFixes.createFromUsage.CreateKotlinCallableAction
class A<T> {
fun getT(): T = null!!
inner class B {
fun test() {
f<caret>oo(getT())
}
}
}
@@ -0,0 +1,17 @@
// "Create function 'foo'" "true"
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.createFromUsage.createCallable.CreateCallableFromUsageFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.k2.codeinsight.quickFixes.createFromUsage.CreateKotlinCallableAction
class A<T> {
fun getT(): T = null!!
inner class B {
fun test() {
foo(getT())
}
private fun foo(t: T) {
TODO("Not yet implemented")
}
}
}