"class" and "class.java" should be available after expression too

This commit is contained in:
Valentin Kipyatkov
2016-06-23 17:02:34 +03:00
parent a25841e9c7
commit cd5ffa5895
2 changed files with 3 additions and 6 deletions
@@ -35,7 +35,6 @@ import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.types.KotlinTypeFactory
import org.jetbrains.kotlin.types.TypeProjectionImpl
import org.jetbrains.kotlin.types.TypeSubstitutor
import org.jetbrains.kotlin.types.expressions.DoubleColonLHS
import org.jetbrains.kotlin.types.typeUtil.isBooleanOrNullableBoolean
object KeywordValues {
@@ -95,9 +94,7 @@ object KeywordValues {
}
if (callTypeAndReceiver is CallTypeAndReceiver.CALLABLE_REFERENCE && callTypeAndReceiver.receiver != null) {
val receiverExpression = callTypeAndReceiver.receiver!!
val qualifierType = (bindingContext.get(BindingContext.DOUBLE_COLON_LHS, receiverExpression) as? DoubleColonLHS.Type)?.type
val qualifierType = bindingContext.get(BindingContext.DOUBLE_COLON_LHS, callTypeAndReceiver.receiver!!)?.type
if (qualifierType != null) {
val kClassDescriptor = resolutionFacade.getFrontendService(ReflectionTypes::class.java).kClass
val classLiteralType = KotlinTypeFactory.simpleNotNullType(Annotations.EMPTY, kClassDescriptor, listOf(TypeProjectionImpl(qualifierType)))
@@ -49,8 +49,8 @@ class C {
}
}
// ABSENT: class
// ABSENT: class.java
// EXIST: class
// EXIST_JAVA_ONLY: class.java
// EXIST: { itemText: "memberFunInA", attributes: "" }
// EXIST: { itemText: "memberValInA", attributes: "" }