Delegated implementations for properties and extension properties.

This commit is contained in:
Dmitry Petrov
2016-09-02 09:47:32 +03:00
committed by Dmitry Petrov
parent d27f22ae0e
commit e42116bb6a
7 changed files with 169 additions and 20 deletions
@@ -43,17 +43,25 @@ interface IrPropertySetter : IrPropertyAccessor {
abstract class IrPropertyAccessorBase(
startOffset: Int,
endOffset: Int,
origin: IrDeclarationOrigin,
body: IrBody
) : IrGeneralFunctionBase(startOffset, endOffset, origin, body), IrPropertyAccessor
origin: IrDeclarationOrigin
) : IrGeneralFunctionBase(startOffset, endOffset, origin), IrPropertyAccessor
class IrPropertyGetterImpl(
startOffset: Int,
endOffset: Int,
origin: IrDeclarationOrigin,
override val descriptor: PropertyGetterDescriptor,
body: IrBody
) : IrPropertyAccessorBase(startOffset, endOffset, origin, body), IrPropertyGetter {
override val descriptor: PropertyGetterDescriptor
) : IrPropertyAccessorBase(startOffset, endOffset, origin), IrPropertyGetter {
constructor(
startOffset: Int,
endOffset: Int,
origin: IrDeclarationOrigin,
descriptor: PropertyGetterDescriptor,
body: IrBody
) : this(startOffset, endOffset, origin, descriptor) {
this.body = body
}
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
visitor.visitPropertyGetter(this, data)
}
@@ -62,9 +70,18 @@ class IrPropertySetterImpl(
startOffset: Int,
endOffset: Int,
origin: IrDeclarationOrigin,
override val descriptor: PropertySetterDescriptor,
body: IrBody
) : IrPropertyAccessorBase(startOffset, endOffset, origin, body), IrPropertySetter {
override val descriptor: PropertySetterDescriptor
) : IrPropertyAccessorBase(startOffset, endOffset, origin), IrPropertySetter {
constructor(
startOffset: Int,
endOffset: Int,
origin: IrDeclarationOrigin,
descriptor: PropertySetterDescriptor,
body: IrBody
) : this(startOffset, endOffset, origin, descriptor) {
this.body = body
}
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
visitor.visitPropertySetter(this, data)
}