Wide visibility in ir common stuff

This commit is contained in:
Mikhael Bogdanov
2017-08-09 11:56:21 +02:00
parent 46d0ea3eed
commit 82c3637d91
@@ -66,7 +66,7 @@ fun IrMemberAccessExpression.getArguments(): List<Pair<ParameterDescriptor, IrEx
* Binds the arguments explicitly represented in the IR to the parameters of the accessed function.
* The arguments are to be evaluated in the same order as they appear in the resulting list.
*/
internal fun IrFunctionAccessExpression.getArgumentsWithSymbols(): List<Pair<IrValueParameterSymbol, IrExpression>> {
fun IrFunctionAccessExpression.getArgumentsWithSymbols(): List<Pair<IrValueParameterSymbol, IrExpression>> {
val res = mutableListOf<Pair<IrValueParameterSymbol, IrExpression>>()
val irFunction = symbol.owner as IrFunction
@@ -91,7 +91,7 @@ internal fun IrFunctionAccessExpression.getArgumentsWithSymbols(): List<Pair<IrV
/**
* Sets arguments that are specified by given mapping of parameters.
*/
internal fun IrMemberAccessExpression.addArguments(args: Map<ParameterDescriptor, IrExpression>) {
fun IrMemberAccessExpression.addArguments(args: Map<ParameterDescriptor, IrExpression>) {
descriptor.dispatchReceiverParameter?.let {
val arg = args[it]
if (arg != null) {
@@ -114,10 +114,10 @@ internal fun IrMemberAccessExpression.addArguments(args: Map<ParameterDescriptor
}
}
internal fun IrMemberAccessExpression.addArguments(args: List<Pair<ParameterDescriptor, IrExpression>>) =
fun IrMemberAccessExpression.addArguments(args: List<Pair<ParameterDescriptor, IrExpression>>) =
this.addArguments(args.toMap())
internal fun IrExpression.isNullConst() = this is IrConst<*> && this.kind == IrConstKind.Null
fun IrExpression.isNullConst() = this is IrConst<*> && this.kind == IrConstKind.Null
fun IrCall.usesDefaultArguments(): Boolean =
this.descriptor.valueParameters.any { this.getValueArgument(it) == null }