diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.kt b/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.kt
index 3cc66395b81..1a8bffe936a 100644
--- a/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.kt
+++ b/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.kt
@@ -77,6 +77,7 @@ fun KotlinType.isPrimitiveNumberOrNullableType(): Boolean =
fun KotlinType.isTypeParameter(): Boolean = TypeUtils.isTypeParameter(this)
fun KotlinType.isInterface(): Boolean = (constructor.declarationDescriptor as? ClassDescriptor)?.kind == ClassKind.INTERFACE
+fun KotlinType.isEnum(): Boolean = (constructor.declarationDescriptor as? ClassDescriptor)?.kind == ClassKind.ENUM_CLASS
fun KotlinType?.isArrayOfNothing(): Boolean {
if (this == null || !KotlinBuiltIns.isArray(this)) return false
diff --git a/idea/src/org/jetbrains/kotlin/idea/parameterInfo/TypeHints.kt b/idea/src/org/jetbrains/kotlin/idea/parameterInfo/TypeHints.kt
index 4945d8ba5c0..3259e4ba997 100644
--- a/idea/src/org/jetbrains/kotlin/idea/parameterInfo/TypeHints.kt
+++ b/idea/src/org/jetbrains/kotlin/idea/parameterInfo/TypeHints.kt
@@ -8,15 +8,13 @@ package org.jetbrains.kotlin.idea.parameterInfo
import com.intellij.codeInsight.hints.InlayInfo
import com.intellij.psi.PsiElement
import com.intellij.psi.codeStyle.CodeStyleSettingsManager
-import org.jetbrains.kotlin.descriptors.ClassDescriptor
-import org.jetbrains.kotlin.descriptors.ClassifierDescriptor
-import org.jetbrains.kotlin.descriptors.ConstructorDescriptor
-import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor
+import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.idea.caches.resolve.analyze
import org.jetbrains.kotlin.idea.caches.resolve.getResolutionFacade
import org.jetbrains.kotlin.idea.caches.resolve.resolveToCall
import org.jetbrains.kotlin.idea.core.formatter.KotlinCodeStyleSettings
import org.jetbrains.kotlin.idea.intentions.SpecifyTypeExplicitlyIntention
+import org.jetbrains.kotlin.idea.references.resolveMainReferenceToDescriptors
import org.jetbrains.kotlin.idea.util.getResolutionScope
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
import org.jetbrains.kotlin.load.java.sam.SamConstructorDescriptor
@@ -28,6 +26,7 @@ import org.jetbrains.kotlin.renderer.DescriptorRenderer
import org.jetbrains.kotlin.renderer.RenderingFormat
import org.jetbrains.kotlin.renderer.renderFqName
import org.jetbrains.kotlin.resolve.BindingContext
+import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.descriptorUtil.isCompanionObject
import org.jetbrains.kotlin.resolve.descriptorUtil.parentsWithSelf
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
@@ -35,6 +34,7 @@ import org.jetbrains.kotlin.resolve.scopes.utils.findClassifier
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.typeUtil.containsError
import org.jetbrains.kotlin.types.typeUtil.immediateSupertypes
+import org.jetbrains.kotlin.types.typeUtil.isEnum
//hack to separate type presentation from param info presentation
const val TYPE_INFO_PREFIX = "@TYPE@"
@@ -106,11 +106,13 @@ fun provideTypeHint(element: KtCallableDeclaration, offset: Int): List = E.test
+ """.trimIndent()
+ )
+ }
+
+ fun testEnumEntryLikeFunction() {
+ checkPropertyHint(
+ """
+ enum class E { ENTRY;
+ companion object {
+ fun test(): E = ENTRY
+ }
+ }
+
+ val test = E.test()
+ """.trimIndent()
+ )
+ }
+
+ fun testImportedEnumEntry() {
+ checkPropertyHint(
+ """
+ import E.ENTRY
+ enum class E { ENTRY }
+ val test = ENTRY
+ """.trimIndent()
+ )
+ }
+
+ fun testEnumEntryCompanion() {
+ checkPropertyHint(
+ """
+ enum class E {
+ ENTRY;
+ companion object {}
+ }
+ val test = E.Companion
+ """
+ )
+ }
+
+ fun testEnumEntryQualified() {
+ checkPropertyHint(
+ """
+ package a
+ enum class E { ENTRY }
+ val test = a.E.ENTRY
+ """
+ )
+ }
+
fun testDestructuring() {
checkLocalVariable(
"""