From 85b36dcd88a5005eedf6a041f6592109befe786d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven=20Sch=C3=A4fer?= Date: Fri, 15 Nov 2019 18:14:05 +0100 Subject: [PATCH] IR: Introduce IrClassifierSymbol.defaultType --- .../lower/AbstractSuspendFunctionsLowering.kt | 5 +++-- .../common/lower/DefaultArgumentStubGenerator.kt | 4 ++-- .../common/lower/loops/ProgressionHandlers.kt | 2 +- .../ir/backend/js/lower/ClassReferenceLowering.kt | 5 ++--- .../kotlin/ir/backend/js/lower/ConstLowering.kt | 7 +++---- .../kotlin/backend/jvm/JvmBackendFacade.kt | 6 +++--- .../org/jetbrains/kotlin/backend/jvm/JvmSymbols.kt | 14 +++++++------- .../kotlin/backend/jvm/codegen/IrTypeMapper.kt | 2 +- .../backend/jvm/lower/CallableReferenceLowering.kt | 4 ++-- .../backend/jvm/lower/MappedEnumWhenLowering.kt | 3 ++- .../backend/jvm/lower/SyntheticAccessorLowering.kt | 9 +++------ .../src/org/jetbrains/kotlin/ir/types/irTypes.kt | 11 ++++++++++- 12 files changed, 39 insertions(+), 33 deletions(-) diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/AbstractSuspendFunctionsLowering.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/AbstractSuspendFunctionsLowering.kt index 0139e06eee3..ceac40d48f4 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/AbstractSuspendFunctionsLowering.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/AbstractSuspendFunctionsLowering.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -31,6 +31,7 @@ import org.jetbrains.kotlin.ir.symbols.impl.IrFieldSymbolImpl import org.jetbrains.kotlin.ir.symbols.impl.IrSimpleFunctionSymbolImpl import org.jetbrains.kotlin.ir.types.IrType import org.jetbrains.kotlin.ir.types.classifierOrFail +import org.jetbrains.kotlin.ir.types.defaultType import org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeImpl import org.jetbrains.kotlin.ir.types.typeWith import org.jetbrains.kotlin.ir.util.* @@ -319,7 +320,7 @@ abstract class AbstractSuspendFunctionsLowering(val co private val coroutineConstructors = mutableListOf() fun build(): BuiltCoroutine { - val superTypes = mutableListOf(coroutineBaseClass.owner.defaultType) + val superTypes = mutableListOf(coroutineBaseClass.defaultType) var suspendFunctionClass: IrClass? = null var functionClass: IrClass? = null val suspendFunctionClassTypeArguments: List? diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/DefaultArgumentStubGenerator.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/DefaultArgumentStubGenerator.kt index 8c7d56c1226..992f5006ab4 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/DefaultArgumentStubGenerator.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/DefaultArgumentStubGenerator.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -382,7 +382,7 @@ private fun IrFunction.generateDefaultsFunctionImpl(context: CommonBackendContex newFunction.addValueParameter("mask$i".synthesizedString, context.irBuiltIns.intType) } if (this is IrConstructor) { - val markerType = context.ir.symbols.defaultConstructorMarker.owner.defaultType.makeNullable() + val markerType = context.ir.symbols.defaultConstructorMarker.defaultType.makeNullable() newFunction.addValueParameter("marker".synthesizedString, markerType) } else if (context.ir.shouldGenerateHandlerParameterForDefaultBodyFun()) { newFunction.addValueParameter("handler".synthesizedString, context.irBuiltIns.anyNType) diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/ProgressionHandlers.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/ProgressionHandlers.kt index 7294e6ae88f..846591d9277 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/ProgressionHandlers.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/ProgressionHandlers.kt @@ -228,7 +228,7 @@ internal class StepHandler( private val symbols = context.ir.symbols override val matcher = SimpleCalleeMatcher { - singleArgumentExtension(FqName("kotlin.ranges.step"), symbols.progressionClasses.map { it.owner.defaultType }) + singleArgumentExtension(FqName("kotlin.ranges.step"), symbols.progressionClasses.map { it.defaultType }) parameter(0) { it.type.isInt() || it.type.isLong() } } diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ClassReferenceLowering.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ClassReferenceLowering.kt index 8a75b147515..cffb4d09c6b 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ClassReferenceLowering.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ClassReferenceLowering.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -15,7 +15,6 @@ import org.jetbrains.kotlin.ir.expressions.IrClassReference import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.expressions.IrGetClass import org.jetbrains.kotlin.ir.types.* -import org.jetbrains.kotlin.ir.util.defaultType import org.jetbrains.kotlin.ir.util.isFunction import org.jetbrains.kotlin.ir.util.isThrowable import org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid @@ -79,7 +78,7 @@ class ClassReferenceLowering(val context: JsIrBackendContext) : FileLoweringPass private fun getPrimitiveClass(target: IrSimpleFunction, returnType: IrType) = JsIrBuilder.buildCall(target.symbol, returnType).apply { - dispatchReceiver = JsIrBuilder.buildGetObjectValue(primitiveClassesObject.owner.defaultType, primitiveClassesObject) + dispatchReceiver = JsIrBuilder.buildGetObjectValue(primitiveClassesObject.defaultType, primitiveClassesObject) } private fun getFinalPrimitiveKClass(returnType: IrType, typeArgument: IrType): IrCall? { diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ConstLowering.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ConstLowering.kt index b3408b7d8b1..726677f6c8b 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ConstLowering.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ConstLowering.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -8,7 +8,6 @@ package org.jetbrains.kotlin.ir.backend.js.lower import org.jetbrains.kotlin.backend.common.FileLoweringPass import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET import org.jetbrains.kotlin.ir.backend.js.JsIrBackendContext -import org.jetbrains.kotlin.ir.backend.js.ir.JsIrBuilder import org.jetbrains.kotlin.ir.declarations.IrFile import org.jetbrains.kotlin.ir.expressions.IrConst import org.jetbrains.kotlin.ir.expressions.IrConstKind @@ -18,8 +17,8 @@ import org.jetbrains.kotlin.ir.expressions.impl.IrConstructorCallImpl import org.jetbrains.kotlin.ir.symbols.IrClassSymbol import org.jetbrains.kotlin.ir.types.IrType import org.jetbrains.kotlin.ir.types.classifierOrNull +import org.jetbrains.kotlin.ir.types.defaultType import org.jetbrains.kotlin.ir.util.constructors -import org.jetbrains.kotlin.ir.util.defaultType import org.jetbrains.kotlin.ir.util.isUnsigned import org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid @@ -33,7 +32,7 @@ class ConstTransformer(private val context: JsIrBackendContext) : IrElementTrans ): IrExpression { val constructor = irClass.constructors.single() val argType = constructor.owner.valueParameters.first().type - return IrConstructorCallImpl.fromSymbolOwner(irClass.owner.defaultType, constructor).apply { + return IrConstructorCallImpl.fromSymbolOwner(irClass.defaultType, constructor).apply { for (i in args.indices) { putValueArgument(i, carrierFactory(UNDEFINED_OFFSET, UNDEFINED_OFFSET, argType, args[i])) } diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmBackendFacade.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmBackendFacade.kt index 7f1deeee34f..4b971b8f0b9 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmBackendFacade.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmBackendFacade.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -16,9 +16,9 @@ import org.jetbrains.kotlin.ir.builders.declarations.buildClass import org.jetbrains.kotlin.ir.declarations.IrClass import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin import org.jetbrains.kotlin.ir.declarations.IrModuleFragment +import org.jetbrains.kotlin.ir.types.defaultType import org.jetbrains.kotlin.ir.util.ExternalDependenciesGenerator import org.jetbrains.kotlin.ir.util.SymbolTable -import org.jetbrains.kotlin.ir.util.defaultType import org.jetbrains.kotlin.ir.util.render import org.jetbrains.kotlin.load.kotlin.JvmPackagePartSource import org.jetbrains.kotlin.psi.KtFile @@ -60,7 +60,7 @@ object JvmBackendFacade { context.methodSignatureMapper.mapAsmMethod(context.referenceFunction(descriptor).owner) } state.mapInlineClass = { descriptor -> - context.typeMapper.mapType(context.referenceClass(descriptor).owner.defaultType) + context.typeMapper.mapType(context.referenceClass(descriptor).defaultType) } //TODO ExternalDependenciesGenerator( diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmSymbols.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmSymbols.kt index 6be9eaad6dc..1d3be9fe7ff 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmSymbols.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmSymbols.kt @@ -235,7 +235,7 @@ class JvmSymbols( } val suspendLambdaClass: IrClassSymbol = createClass(FqName("kotlin.coroutines.jvm.internal.SuspendLambda")) { klass -> - klass.superTypes += suspendFunctionInterface.owner.defaultType + klass.superTypes += suspendFunctionInterface.defaultType klass.addConstructor().apply { addValueParameter("arity", irBuiltIns.intType) addValueParameter("completion", continuationClass.typeWith(irBuiltIns.anyNType).makeNullable()) @@ -255,7 +255,7 @@ class JvmSymbols( private fun generateCallableReferenceMethods(klass: IrClass) { klass.addFunction("getSignature", irBuiltIns.stringType, Modality.OPEN) klass.addFunction("getName", irBuiltIns.stringType, Modality.OPEN) - klass.addFunction("getOwner", irBuiltIns.kDeclarationContainerClass.owner.defaultType, Modality.OPEN) + klass.addFunction("getOwner", irBuiltIns.kDeclarationContainerClass.defaultType, Modality.OPEN) } val functionReference: IrClassSymbol = createClass(FqName("kotlin.jvm.internal.FunctionReference")) { klass -> @@ -346,11 +346,11 @@ class JvmSymbols( ) { klass -> if (impl) { klass.addConstructor().apply { - addValueParameter("owner", irBuiltIns.kDeclarationContainerClass.owner.defaultType) + addValueParameter("owner", irBuiltIns.kDeclarationContainerClass.defaultType) addValueParameter("name", irBuiltIns.stringType) addValueParameter("string", irBuiltIns.stringType) } - klass.superTypes += getPropertyReferenceClass(mutable, parameterCount, false).owner.defaultType + klass.superTypes += getPropertyReferenceClass(mutable, parameterCount, false).defaultType } else { klass.addConstructor() @@ -405,7 +405,7 @@ class JvmSymbols( val javaLangClassType = javaLangClass.starProjectedType val kClassType = irBuiltIns.kClassClass.starProjectedType - klass.addFunction("getOrCreateKotlinPackage", irBuiltIns.kDeclarationContainerClass.owner.defaultType, isStatic = true).apply { + klass.addFunction("getOrCreateKotlinPackage", irBuiltIns.kDeclarationContainerClass.defaultType, isStatic = true).apply { addValueParameter("javaClass", javaLangClassType) addValueParameter("moduleName", irBuiltIns.stringType) } @@ -422,7 +422,7 @@ class JvmSymbols( for (n in 0..2) { val functionName = (if (mutable) "mutableProperty" else "property") + n klass.addFunction(functionName, irBuiltIns.getKPropertyClass(mutable, n).starProjectedType, isStatic = true).apply { - addValueParameter("p", getPropertyReferenceClass(mutable, n, impl = false).owner.defaultType) + addValueParameter("p", getPropertyReferenceClass(mutable, n, impl = false).defaultType) } } } @@ -530,7 +530,7 @@ class JvmSymbols( addValueParameter("element", irType) } - klass.addFunction("toArray", irBuiltIns.primitiveArrayForType.getValue(irType).owner.defaultType) + klass.addFunction("toArray", irBuiltIns.primitiveArrayForType.getValue(irType).defaultType) } } diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/IrTypeMapper.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/IrTypeMapper.kt index ab3419182e2..75875ce9248 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/IrTypeMapper.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/IrTypeMapper.kt @@ -44,7 +44,7 @@ class IrTypeMapper(private val context: JvmBackendContext) : KotlinTypeMapperBas is ClassDescriptor -> mapClass(context.referenceClass(classifier).owner) is TypeParameterDescriptor -> - mapType(context.referenceTypeParameter(classifier).owner.defaultType) + mapType(context.referenceTypeParameter(classifier).defaultType) else -> error("Unknown descriptor: $classifier") } diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/CallableReferenceLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/CallableReferenceLowering.kt index 67bc5e31adf..80d58426f45 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/CallableReferenceLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/CallableReferenceLowering.kt @@ -128,7 +128,7 @@ internal class CallableReferenceLowering(private val context: JvmBackendContext) private val superMethod = functionSuperClass.functions.single { it.owner.modality == Modality.ABSTRACT } private val superType = - samSuperType ?: (if (isLambda) context.ir.symbols.lambdaClass else context.ir.symbols.functionReference).owner.defaultType + samSuperType ?: (if (isLambda) context.ir.symbols.lambdaClass else context.ir.symbols.functionReference).defaultType private val functionReferenceClass = buildClass { setSourceRange(irFunctionReference) @@ -142,7 +142,7 @@ internal class CallableReferenceLowering(private val context: JvmBackendContext) superTypes += superType if (samSuperType == null) superTypes += functionSuperClass.typeWith(parameterTypes) - if (irFunctionReference.isSuspend) superTypes += context.ir.symbols.suspendFunctionInterface.owner.defaultType + if (irFunctionReference.isSuspend) superTypes += context.ir.symbols.suspendFunctionInterface.defaultType createImplicitParameterDeclarationWithWrappedDescriptor() copyAttributes(irFunctionReference) } diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/MappedEnumWhenLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/MappedEnumWhenLowering.kt index 98fc015afce..e55dd6ab0db 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/MappedEnumWhenLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/MappedEnumWhenLowering.kt @@ -21,6 +21,7 @@ import org.jetbrains.kotlin.ir.declarations.IrEnumEntry import org.jetbrains.kotlin.ir.declarations.IrField import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.expressions.impl.IrGetEnumValueImpl +import org.jetbrains.kotlin.ir.types.defaultType import org.jetbrains.kotlin.ir.types.getClass import org.jetbrains.kotlin.ir.util.* import org.jetbrains.kotlin.name.Name @@ -83,7 +84,7 @@ private class MappedEnumWhenLowering(context: CommonBackendContext) : EnumWhenLo mappings.getOrPut(enumClass) { mutableMapOf() to mappingsClass.addField { name = Name.identifier("\$EnumSwitchMapping\$${mappings.size}") - type = intArray.owner.defaultType + type = intArray.defaultType origin = JvmLoweredDeclarationOrigin.ENUM_MAPPINGS_FOR_WHEN isFinal = true isStatic = true diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt index e1526b0313a..d414c178ce3 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt @@ -31,10 +31,7 @@ import org.jetbrains.kotlin.ir.declarations.impl.IrConstructorImpl import org.jetbrains.kotlin.ir.expressions.* import org.jetbrains.kotlin.ir.expressions.impl.* import org.jetbrains.kotlin.ir.symbols.* -import org.jetbrains.kotlin.ir.types.classOrNull -import org.jetbrains.kotlin.ir.types.classifierOrNull -import org.jetbrains.kotlin.ir.types.isSubtypeOfClass -import org.jetbrains.kotlin.ir.types.makeNullable +import org.jetbrains.kotlin.ir.types.* import org.jetbrains.kotlin.ir.util.* import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid import org.jetbrains.kotlin.load.java.JavaVisibilities @@ -169,7 +166,7 @@ internal class SyntheticAccessorLowering(val context: JvmBackendContext) : IrEle accessor.returnType = source.returnType.remapTypeParameters(source, accessor) accessor.addValueParameter( - "marker", context.ir.symbols.defaultConstructorMarker.owner.defaultType, JvmLoweredDeclarationOrigin.SYNTHETIC_ACCESSOR + "marker", context.ir.symbols.defaultConstructorMarker.defaultType, JvmLoweredDeclarationOrigin.SYNTHETIC_ACCESSOR ) accessor.body = IrExpressionBodyImpl( @@ -370,7 +367,7 @@ internal class SyntheticAccessorLowering(val context: JvmBackendContext) : IrEle IrConstImpl.constNull( UNDEFINED_OFFSET, UNDEFINED_OFFSET, - context.ir.symbols.defaultConstructorMarker.owner.defaultType.makeNullable() + context.ir.symbols.defaultConstructorMarker.defaultType.makeNullable() ) ) } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/irTypes.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/irTypes.kt index 7b8b0ed846e..c9c7b80630f 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/irTypes.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/irTypes.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -10,7 +10,9 @@ import org.jetbrains.kotlin.ir.declarations.IrClass import org.jetbrains.kotlin.ir.declarations.IrTypeParameter import org.jetbrains.kotlin.ir.symbols.IrClassSymbol import org.jetbrains.kotlin.ir.symbols.IrClassifierSymbol +import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol import org.jetbrains.kotlin.ir.types.impl.* +import org.jetbrains.kotlin.ir.util.defaultType import org.jetbrains.kotlin.types.* import org.jetbrains.kotlin.types.typeUtil.makeNotNullable import org.jetbrains.kotlin.types.typeUtil.makeNullable @@ -96,6 +98,13 @@ private fun makeKotlinType( return classifier.descriptor.defaultType.replace(newArguments = kotlinTypeArguments).makeNullableAsSpecified(hasQuestionMark) } +val IrClassifierSymbol.defaultType: IrType + get() = when (this) { + is IrClassSymbol -> owner.defaultType + is IrTypeParameterSymbol -> owner.defaultType + else -> error("Unexpected classifier symbol type $this") + } + val IrTypeParameter.defaultType: IrType get() = IrSimpleTypeImpl( symbol,