KT-12674 "Calling new methods on older versions" errors for inlined constants

Inlined constants from Java should not be detected.
(cherry picked from commit b34ee4e)
This commit is contained in:
Yan Zhulanow
2016-06-15 22:58:40 +03:00
parent 206e439595
commit 8f75ababde
3 changed files with 27 additions and 2 deletions
@@ -16,6 +16,7 @@
package org.jetbrains.uast.java
import com.intellij.psi.PsiClassType
import com.intellij.psi.PsiPrimitiveType
import com.intellij.psi.PsiType
import org.jetbrains.uast.UClass
import org.jetbrains.uast.UElement
@@ -61,6 +62,12 @@ class JavaUType(
override val isByte: Boolean
get() = check("byte", "java.lang.Byte")
val isString: Boolean
get() = (psi as? PsiClassType)?.resolve()?.qualifiedName == "java.lang.String"
val isPrimitive: Boolean
get() = psi is PsiPrimitiveType
@Suppress("NOTHING_TO_INLINE")
private inline fun check(unboxedType: String, boxedType: String): Boolean =