Hi everybody! I start to write a custom Detekt rul...
# detekt
e
Hi everybody! I start to write a custom Detekt rules. But run across some difficulties. Could someone help me recognize if it is an enum or not? I tried to use
isEnum
, but it returned null.
Copy code
override fun visitDotQualifiedExpression(expression: KtDotQualifiedExpression) {
    super.visitDotQualifiedExpression(expression)
    val receiverKotlinTypeInfo: KotlinTypeInfo? = bindingContext[BindingContext.EXPRESSION_TYPE_INFO, expression]
    // but receiverKotlinTypeInfo is null, so
    val receiverKotlinType: KotlinType? = receiverKotlinTypeInfo?.type
    // is also null: receiverKotlinType == null
}
bindingContext[BindingContext.EXPRESSION_TYPE_INFO, expression]
is null, but the expression is correct. In the logs, I got this:
receiverExpression.text = TestEnum.TEST2
- and it is my test enum with a child.
1
@t-kameyama hi maybe you could help me)