KT-12023 Kotlin Lint: Cast doesn't trigger minSdk error
Check Kotlin as/is types. (cherry picked from commit c0db8e0)
This commit is contained in:
+4
@@ -18,6 +18,7 @@ package org.jetbrains.uast.java
|
||||
import com.intellij.psi.PsiInstanceOfExpression
|
||||
import org.jetbrains.uast.UBinaryExpressionWithType
|
||||
import org.jetbrains.uast.UElement
|
||||
import org.jetbrains.uast.UTypeReference
|
||||
import org.jetbrains.uast.UastBinaryExpressionWithTypeKind
|
||||
import org.jetbrains.uast.psi.PsiElementBacked
|
||||
|
||||
@@ -27,6 +28,9 @@ class JavaUInstanceCheckExpression(
|
||||
) : JavaAbstractUElement(), UBinaryExpressionWithType, PsiElementBacked, JavaUElementWithType, JavaEvaluatableUElement {
|
||||
override val operand by lz { JavaConverter.convertOrEmpty(psi.operand, this) }
|
||||
override val type by lz { JavaConverter.convert(psi.checkType?.type, this) }
|
||||
|
||||
override val typeReference: UTypeReference?
|
||||
get() = null
|
||||
|
||||
override val operationKind: UastBinaryExpressionWithTypeKind.InstanceCheck
|
||||
get() = UastBinaryExpressionWithTypeKind.INSTANCE_CHECK
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.jetbrains.uast.java
|
||||
import com.intellij.psi.PsiTypeCastExpression
|
||||
import org.jetbrains.uast.UBinaryExpressionWithType
|
||||
import org.jetbrains.uast.UElement
|
||||
import org.jetbrains.uast.UTypeReference
|
||||
import org.jetbrains.uast.UastBinaryExpressionWithTypeKind
|
||||
import org.jetbrains.uast.psi.PsiElementBacked
|
||||
|
||||
@@ -28,6 +29,9 @@ class JavaUTypeCastExpression(
|
||||
override val operand by lz { JavaConverter.convertOrEmpty(psi.operand, this) }
|
||||
override val type by lz { JavaConverter.convert(psi.castType?.type, this) }
|
||||
|
||||
override val typeReference: UTypeReference?
|
||||
get() = null
|
||||
|
||||
override val operationKind: UastBinaryExpressionWithTypeKind.TypeCast
|
||||
get() = UastBinaryExpressionWithTypeKind.TYPE_CAST
|
||||
}
|
||||
Reference in New Issue
Block a user