From 17454d3f9c6851091ba08a7cc0aebc50c2ecfccd Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Sun, 24 Jun 2018 01:21:26 +0300 Subject: [PATCH] ir.tree: fix return type of `IrMemberAccessExpression.getTypeArgumentOrDefault` (cherry picked from commit 9e7661f) --- .../ir/expressions/IrMemberAccessExpression.kt | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrMemberAccessExpression.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrMemberAccessExpression.kt index 1fd0379f950..90bb8f71ab5 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrMemberAccessExpression.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrMemberAccessExpression.kt @@ -1,17 +1,6 @@ /* - * Copyright 2010-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.ir.expressions @@ -19,6 +8,7 @@ package org.jetbrains.kotlin.ir.expressions import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.ir.symbols.IrFunctionSymbol import org.jetbrains.kotlin.ir.types.IrType +import org.jetbrains.kotlin.ir.types.toKotlinType import org.jetbrains.kotlin.types.KotlinType interface IrMemberAccessExpression : IrExpression { @@ -68,7 +58,7 @@ val CallableDescriptor.typeParametersCount: Int } fun IrMemberAccessExpression.getTypeArgumentOrDefault(typeParameterDescriptor: TypeParameterDescriptor) = - getTypeArgument(typeParameterDescriptor) ?: typeParameterDescriptor.defaultType + getTypeArgument(typeParameterDescriptor)?.toKotlinType() ?: typeParameterDescriptor.defaultType interface IrFunctionAccessExpression : IrMemberAccessExpression, IrDeclarationReference { override val descriptor: FunctionDescriptor