Replace 'addOverriddenDescriptor' with 'setOverriddenDescriptors'

It helps to get rid of redundant SmartSets (e.g. for top-level functions)
This commit is contained in:
Denis Zharkov
2016-02-08 11:38:46 +03:00
parent c1f57b743b
commit fae6de9acd
14 changed files with 56 additions and 43 deletions
@@ -25,6 +25,7 @@ import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl
import org.jetbrains.kotlin.descriptors.impl.ValueParameterDescriptorImpl
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.descriptorUtil.setSingleOverridden
import org.jetbrains.kotlin.types.TypeSubstitutor
import org.jetbrains.kotlin.util.OperatorNameConventions
import java.util.*
@@ -48,7 +49,7 @@ fun createSynthesizedInvokes(functions: Collection<FunctionDescriptor>): Collect
CallableMemberDescriptor.Kind.FAKE_OVERRIDE,
true
)
fakeOverride.addOverriddenDescriptor(synthesizedSuperFun)
fakeOverride.setSingleOverridden(synthesizedSuperFun)
fakeOverride
}