HighLevelParamInfoHandler: Enable tests related to parameter name in function types.

GitOrigin-RevId: 145aefb5a04884d66f02b6dee86508c4f2f11df3
This commit is contained in:
Mark Punzalan
2022-02-08 08:48:59 +00:00
committed by intellij-monorepo-bot
parent ecbdadb6d0
commit 6fa7fdfd50
9 changed files with 59 additions and 6 deletions
@@ -312,6 +312,21 @@ public abstract class FirParameterInfoTestGenerated extends AbstractFirParameter
runTest("../idea/tests/testData/parameterInfo/functionCall/OtherConstructorFromSecondary.kt");
}
@TestMetadata("ParameterNameAnnotationConflict.kt")
public void testParameterNameAnnotationConflict() throws Exception {
runTest("../idea/tests/testData/parameterInfo/functionCall/ParameterNameAnnotationConflict.kt");
}
@TestMetadata("ParameterNameAnnotationInFunctionType.kt")
public void testParameterNameAnnotationInFunctionType() throws Exception {
runTest("../idea/tests/testData/parameterInfo/functionCall/ParameterNameAnnotationInFunctionType.kt");
}
@TestMetadata("ParameterNameAnnotationInNonFunctionType.kt")
public void testParameterNameAnnotationInNonFunctionType() throws Exception {
runTest("../idea/tests/testData/parameterInfo/functionCall/ParameterNameAnnotationInNonFunctionType.kt");
}
@TestMetadata("Println.kt")
public void testPrintln() throws Exception {
runTest("../idea/tests/testData/parameterInfo/functionCall/Println.kt");
@@ -312,6 +312,21 @@ public abstract class ParameterInfoTestGenerated extends AbstractParameterInfoTe
runTest("testData/parameterInfo/functionCall/OtherConstructorFromSecondary.kt");
}
@TestMetadata("ParameterNameAnnotationConflict.kt")
public void testParameterNameAnnotationConflict() throws Exception {
runTest("testData/parameterInfo/functionCall/ParameterNameAnnotationConflict.kt");
}
@TestMetadata("ParameterNameAnnotationInFunctionType.kt")
public void testParameterNameAnnotationInFunctionType() throws Exception {
runTest("testData/parameterInfo/functionCall/ParameterNameAnnotationInFunctionType.kt");
}
@TestMetadata("ParameterNameAnnotationInNonFunctionType.kt")
public void testParameterNameAnnotationInNonFunctionType() throws Exception {
runTest("testData/parameterInfo/functionCall/ParameterNameAnnotationInNonFunctionType.kt");
}
@TestMetadata("Println.kt")
public void testPrintln() throws Exception {
runTest("testData/parameterInfo/functionCall/Println.kt");
@@ -1,4 +1,3 @@
// IGNORE_FIR
fun x(name: String, next: (name: String) -> String): String {
return next(<caret>)
}
@@ -1,4 +1,3 @@
// IGNORE_FIR
typealias Handler = (name: String) -> String
fun x(handler: Handler): String {
@@ -1,6 +1,3 @@
// IGNORE_FIR
// COMPILER_ARGUMENTS: -XXLanguage:-NewInference
fun <T> T.foo(): (item: T) -> Unit{}
fun f() {
@@ -1,4 +1,3 @@
// IGNORE_FIR
interface I<T> {
fun foo(t: T): (item: T) -> Unit{}
}
@@ -0,0 +1,11 @@
// @ParameterName annotation takes precedence over name in function type parameter
fun <T> T.foo(): (notMe: @ParameterName("pickMe") T) -> Unit{}
fun f() {
val v = "a".foo()
v(<caret>)
}
/*
Text: (<highlight>pickMe: String</highlight>), Disabled: false, Strikeout: false, Green: true
*/
@@ -0,0 +1,10 @@
fun <T> T.foo(): Function1<@ParameterName("item") T, @ParameterName("item") Unit>
fun f() {
val v = "a".foo()
v(<caret>)
}
/*
Text: (<highlight>item: String</highlight>), Disabled: false, Strikeout: false, Green: true
*/
@@ -0,0 +1,8 @@
// @ParameterName annotation is ignored when not used in function type
fun f(pickMe: @ParameterName("notMe") String) {
f(<caret>)
}
/*
Text: (<highlight>pickMe: String</highlight>), Disabled: false, Strikeout: false, Green: true
*/