Minor: IrSyntheticPropertyAccessorDescriptor.Kind.

This commit is contained in:
Dmitry Petrov
2016-08-30 12:08:13 +03:00
committed by Dmitry Petrov
parent 7adf173a66
commit a140d75016
2 changed files with 23 additions and 13 deletions
@@ -20,9 +20,11 @@ import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.descriptors.PropertyGetterDescriptor
import org.jetbrains.kotlin.descriptors.PropertySetterDescriptor
import org.jetbrains.kotlin.ir.descriptors.IrSyntheticStaticPropertyGetterDescriptorImpl
import org.jetbrains.kotlin.ir.descriptors.IrSyntheticStaticPropertySetterDescriptorImpl
import org.jetbrains.kotlin.ir.descriptors.IrSyntheticPropertyAccessorDescriptor.Kind.STATIC_PROPERTY
import org.jetbrains.kotlin.ir.descriptors.IrSyntheticPropertyGetterDescriptorImpl
import org.jetbrains.kotlin.ir.descriptors.IrSyntheticPropertySetterDescriptorImpl
import org.jetbrains.kotlin.storage.StorageManager
import java.lang.AssertionError
class SyntheticDescriptorsFactory(storageManager: StorageManager) {
@@ -30,7 +32,7 @@ class SyntheticDescriptorsFactory(storageManager: StorageManager) {
property ->
when {
isStaticPropertyInClass(property) ->
IrSyntheticStaticPropertyGetterDescriptorImpl(property)
IrSyntheticPropertyGetterDescriptorImpl(property, STATIC_PROPERTY)
else ->
throw AssertionError("Don't know how to create synthetic getter for $property")
}
@@ -40,7 +42,7 @@ class SyntheticDescriptorsFactory(storageManager: StorageManager) {
property ->
when {
isStaticPropertyInClass(property) ->
IrSyntheticStaticPropertySetterDescriptorImpl(property)
IrSyntheticPropertySetterDescriptorImpl(property, STATIC_PROPERTY)
else ->
throw AssertionError("Don't know how to create synthetic setter for $property")
}
@@ -25,14 +25,21 @@ import org.jetbrains.kotlin.descriptors.impl.PropertyGetterDescriptorImpl
import org.jetbrains.kotlin.descriptors.impl.PropertySetterDescriptorImpl
interface IrSyntheticStaticPropertyAccessorDescriptor : PropertyAccessorDescriptor
interface IrSyntheticPropertyAccessorDescriptor : PropertyAccessorDescriptor {
enum class Kind {
STATIC_PROPERTY
}
interface IrSyntheticStaticPropertyGetterDescriptor : IrSyntheticStaticPropertyAccessorDescriptor
val kind: Kind
}
interface IrSyntheticStaticPropertySetterDescriptor : IrSyntheticStaticPropertyAccessorDescriptor
interface IrSyntheticPropertyGetterDescriptor : IrSyntheticPropertyAccessorDescriptor
class IrSyntheticStaticPropertyGetterDescriptorImpl(
correspondingProperty: PropertyDescriptor
interface IrSyntheticPropertySetterDescriptor : IrSyntheticPropertyAccessorDescriptor
class IrSyntheticPropertyGetterDescriptorImpl(
correspondingProperty: PropertyDescriptor,
override val kind: IrSyntheticPropertyAccessorDescriptor.Kind
) : PropertyGetterDescriptorImpl(
correspondingProperty,
Annotations.EMPTY,
@@ -44,14 +51,15 @@ class IrSyntheticStaticPropertyGetterDescriptorImpl(
CallableMemberDescriptor.Kind.SYNTHESIZED,
null,
correspondingProperty.source
), IrSyntheticStaticPropertyGetterDescriptor {
), IrSyntheticPropertyGetterDescriptor {
init {
initialize(correspondingProperty.type)
}
}
class IrSyntheticStaticPropertySetterDescriptorImpl(
correspondingProperty: PropertyDescriptor
class IrSyntheticPropertySetterDescriptorImpl(
correspondingProperty: PropertyDescriptor,
override val kind: IrSyntheticPropertyAccessorDescriptor.Kind
) : PropertySetterDescriptorImpl(
correspondingProperty,
Annotations.EMPTY,
@@ -63,7 +71,7 @@ class IrSyntheticStaticPropertySetterDescriptorImpl(
CallableMemberDescriptor.Kind.SYNTHESIZED,
null,
correspondingProperty.source
), IrSyntheticStaticPropertySetterDescriptor {
), IrSyntheticPropertySetterDescriptor {
init {
initializeDefault()
}