Delegated Properties: Analysis adjustments for local delegated properties support

This commit is contained in:
Dotlin
2016-02-07 17:43:15 +03:00
committed by Mikhael Bogdanov
parent 9bfb226948
commit fa523b9af4
32 changed files with 423 additions and 88 deletions
@@ -20,7 +20,7 @@ import org.jetbrains.annotations.NotNull;
import java.util.Collection;
public interface PropertyAccessorDescriptor extends FunctionDescriptor {
public interface PropertyAccessorDescriptor extends VariableAccessorDescriptor {
boolean isDefault();
@NotNull
@@ -23,10 +23,12 @@ import org.jetbrains.kotlin.types.TypeSubstitutor;
import java.util.Collection;
import java.util.List;
public interface PropertyDescriptor extends VariableDescriptor, CallableMemberDescriptor {
public interface PropertyDescriptor extends VariableDescriptorWithAccessors, CallableMemberDescriptor {
@Override
@Nullable
PropertyGetterDescriptor getGetter();
@Override
@Nullable
PropertySetterDescriptor getSetter();
@@ -0,0 +1,21 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.descriptors
public interface VariableAccessorDescriptor : FunctionDescriptor {
val correspondingVariable: VariableDescriptorWithAccessors
}
@@ -0,0 +1,22 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.descriptors
public interface VariableDescriptorWithAccessors : VariableDescriptor {
public val getter: VariableAccessorDescriptor?
public val setter: VariableAccessorDescriptor?
}
@@ -132,6 +132,12 @@ public abstract class PropertyAccessorDescriptorImpl extends DeclarationDescript
this.visibility = visibility;
}
@NotNull
@Override
public VariableDescriptorWithAccessors getCorrespondingVariable() {
return correspondingProperty;
}
@Override
@NotNull
public PropertyDescriptor getCorrespondingProperty() {