Add test for lambda parameter type

This commit is contained in:
Nikolay Krasko
2019-11-26 18:45:28 +03:00
parent eb71e686da
commit 54338686d4
@@ -27,6 +27,7 @@ class InlayTypeHintsTest : KotlinLightCodeInsightFixtureTestCase() {
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 checkFunctionHint(text: String) = check(text, HintType.FUNCTION_HINT)
private fun checkParameterTypeHint(text: String) = check(text, HintType.PARAMETER_TYPE_HINT)
fun testLocalVariableType() {
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
}
}
"""
)
}
}