Add 'isBound' property to IrSymbol

This commit is contained in:
Dmitry Petrov
2017-03-29 16:30:26 +03:00
parent 2b48908586
commit 00e4accb7b
2 changed files with 4 additions and 0 deletions
@@ -22,6 +22,7 @@ import org.jetbrains.kotlin.ir.declarations.*
interface IrSymbol { interface IrSymbol {
val owner : IrSymbolOwner val owner : IrSymbolOwner
val descriptor: DeclarationDescriptor val descriptor: DeclarationDescriptor
val isBound: Boolean
} }
interface IrBindableSymbol<out D : DeclarationDescriptor, B : IrSymbolOwner> : IrSymbol { interface IrBindableSymbol<out D : DeclarationDescriptor, B : IrSymbolOwner> : IrSymbol {
@@ -34,6 +34,9 @@ abstract class IrBindableSymbolBase<out D : DeclarationDescriptor, B : IrSymbolO
else else
throw IllegalStateException("Symbol for $descriptor is already bound") throw IllegalStateException("Symbol for $descriptor is already bound")
} }
override val isBound: Boolean
get() = _owner != null
} }
class IrFileSymbolImpl(descriptor: PackageFragmentDescriptor) : class IrFileSymbolImpl(descriptor: PackageFragmentDescriptor) :