Add test for lambda parameter type
This commit is contained in:
@@ -27,6 +27,7 @@ class InlayTypeHintsTest : KotlinLightCodeInsightFixtureTestCase() {
|
|||||||
private fun checkLocalVariable(text: String) = check(text.trimIndent(), HintType.LOCAL_VARIABLE_HINT)
|
private fun checkLocalVariable(text: String) = check(text.trimIndent(), HintType.LOCAL_VARIABLE_HINT)
|
||||||
private fun checkPropertyHint(text: String) = check(text.trimIndent(), HintType.PROPERTY_HINT)
|
private fun checkPropertyHint(text: String) = check(text.trimIndent(), HintType.PROPERTY_HINT)
|
||||||
private fun checkFunctionHint(text: String) = check(text, HintType.FUNCTION_HINT)
|
private fun checkFunctionHint(text: String) = check(text, HintType.FUNCTION_HINT)
|
||||||
|
private fun checkParameterTypeHint(text: String) = check(text, HintType.PARAMETER_TYPE_HINT)
|
||||||
|
|
||||||
fun testLocalVariableType() {
|
fun testLocalVariableType() {
|
||||||
checkLocalVariable("""fun foo() { val a<hint text=": List<String>" /> = listOf("a") }""")
|
checkLocalVariable("""fun foo() { val a<hint text=": List<String>" /> = listOf("a") }""")
|
||||||
@@ -285,4 +286,17 @@ class InlayTypeHintsTest : KotlinLightCodeInsightFixtureTestCase() {
|
|||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun testParameterType() {
|
||||||
|
checkParameterTypeHint(
|
||||||
|
"""
|
||||||
|
fun <T> T.wrap(lambda: (T) -> T) {}
|
||||||
|
fun foo() {
|
||||||
|
12.wrap { elem<hint text=": Int"/> ->
|
||||||
|
elem
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user