"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.KotlinTypeFactory
import org.jetbrains.kotlin.types.TypeProjectionImpl import org.jetbrains.kotlin.types.TypeProjectionImpl
import org.jetbrains.kotlin.types.TypeSubstitutor import org.jetbrains.kotlin.types.TypeSubstitutor
import org.jetbrains.kotlin.types.expressions.DoubleColonLHS
import org.jetbrains.kotlin.types.typeUtil.isBooleanOrNullableBoolean import org.jetbrains.kotlin.types.typeUtil.isBooleanOrNullableBoolean
object KeywordValues { object KeywordValues {
@@ -95,9 +94,7 @@ object KeywordValues {
} }
if (callTypeAndReceiver is CallTypeAndReceiver.CALLABLE_REFERENCE && callTypeAndReceiver.receiver != null) { if (callTypeAndReceiver is CallTypeAndReceiver.CALLABLE_REFERENCE && callTypeAndReceiver.receiver != null) {
val receiverExpression = callTypeAndReceiver.receiver!! val qualifierType = bindingContext.get(BindingContext.DOUBLE_COLON_LHS, callTypeAndReceiver.receiver!!)?.type
val qualifierType = (bindingContext.get(BindingContext.DOUBLE_COLON_LHS, receiverExpression) as? DoubleColonLHS.Type)?.type
if (qualifierType != null) { if (qualifierType != null) {
val kClassDescriptor = resolutionFacade.getFrontendService(ReflectionTypes::class.java).kClass val kClassDescriptor = resolutionFacade.getFrontendService(ReflectionTypes::class.java).kClass
val classLiteralType = KotlinTypeFactory.simpleNotNullType(Annotations.EMPTY, kClassDescriptor, listOf(TypeProjectionImpl(qualifierType))) val classLiteralType = KotlinTypeFactory.simpleNotNullType(Annotations.EMPTY, kClassDescriptor, listOf(TypeProjectionImpl(qualifierType)))
@@ -49,8 +49,8 @@ class C {
} }
} }
// ABSENT: class // EXIST: class
// ABSENT: class.java // EXIST_JAVA_ONLY: class.java
// EXIST: { itemText: "memberFunInA", attributes: "" } // EXIST: { itemText: "memberFunInA", attributes: "" }
// EXIST: { itemText: "memberValInA", attributes: "" } // EXIST: { itemText: "memberValInA", attributes: "" }