diff --git a/idea/src/org/jetbrains/kotlin/idea/codeInsight/KotlinExpressionTypeProvider.kt b/idea/src/org/jetbrains/kotlin/idea/codeInsight/KotlinExpressionTypeProvider.kt index 7d7d2fbc9df..d028c3279f6 100644 --- a/idea/src/org/jetbrains/kotlin/idea/codeInsight/KotlinExpressionTypeProvider.kt +++ b/idea/src/org/jetbrains/kotlin/idea/codeInsight/KotlinExpressionTypeProvider.kt @@ -37,7 +37,9 @@ class KotlinExpressionTypeProvider : ExpressionTypeProvider() { private fun KtExpression.shouldShowType() = when(this) { is KtFunction -> !hasBlockBody() && !hasDeclaredReturnType() - is KtProperty, is KtDestructuringDeclarationEntry -> true + is KtProperty -> typeReference == null + is KtPropertyAccessor -> false + is KtDestructuringDeclarationEntry -> true is KtStatementExpression, is KtDestructuringDeclaration -> false is KtIfExpression, is KtLoopExpression, is KtWhenExpression, is KtTryExpression -> parent !is KtBlockExpression else -> true diff --git a/idea/testData/codeInsight/expressionType/PropertyAccessor.kt b/idea/testData/codeInsight/expressionType/PropertyAccessor.kt new file mode 100644 index 00000000000..6626297c35a --- /dev/null +++ b/idea/testData/codeInsight/expressionType/PropertyAccessor.kt @@ -0,0 +1,6 @@ +class A { + val x: String + get() = "abc" +} + +// TYPE: "abc" -> String