Provide implicit receiver to extension property initializer
This is safe because initializers for extension properties are forbidden anyway, we'll just won't be generating noisy error messages about non-existent 'this'
This commit is contained in:
@@ -21,7 +21,6 @@ import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import kotlin.Function0;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -937,11 +936,13 @@ public class DescriptorResolver {
|
||||
}
|
||||
}
|
||||
|
||||
ReceiverParameterDescriptor receiverDescriptor = DescriptorFactory.createReceiverParameterForCallable(propertyDescriptor,
|
||||
receiverType);
|
||||
ReceiverParameterDescriptor receiverDescriptor =
|
||||
DescriptorFactory.createReceiverParameterForCallable(propertyDescriptor, receiverType);
|
||||
|
||||
ReceiverParameterDescriptor implicitInitializerReceiver = property.hasDelegate() ? NO_RECEIVER_PARAMETER : receiverDescriptor;
|
||||
|
||||
JetScope propertyScope = JetScopeUtils.getPropertyDeclarationInnerScope(propertyDescriptor, scope, typeParameterDescriptors,
|
||||
NO_RECEIVER_PARAMETER, trace);
|
||||
implicitInitializerReceiver, trace);
|
||||
|
||||
JetType type = getVariableType(propertyDescriptor, propertyScope, property, dataFlowInfo, true, trace);
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package i
|
||||
|
||||
val <T> List<T>.length = <!EXTENSION_PROPERTY_WITH_BACKING_FIELD!><!UNRESOLVED_REFERENCE!>size<!>()<!>
|
||||
val <T> List<T>.length = <!EXTENSION_PROPERTY_WITH_BACKING_FIELD!>size()<!>
|
||||
|
||||
val <T> List<T>.length1 : Int get() = size()
|
||||
|
||||
val String.bd = <!EXTENSION_PROPERTY_WITH_BACKING_FIELD!><!NO_THIS!>this<!> <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>+<!> "!"<!>
|
||||
val String.bd = <!EXTENSION_PROPERTY_WITH_BACKING_FIELD!>this + "!"<!>
|
||||
|
||||
val String.bd1 : String get() = this + "!"
|
||||
|
||||
@@ -13,7 +13,7 @@ class A {
|
||||
val ii : Int = 1
|
||||
}
|
||||
|
||||
val A.foo = <!UNRESOLVED_REFERENCE, EXTENSION_PROPERTY_WITH_BACKING_FIELD!>ii<!>
|
||||
val A.foo = <!EXTENSION_PROPERTY_WITH_BACKING_FIELD!>ii<!>
|
||||
|
||||
val A.foo1 : Int get() = ii
|
||||
|
||||
|
||||
Reference in New Issue
Block a user