diff --git a/compiler/backend.common.jvm/src/org/jetbrains/kotlin/types/AbstractTypeMapper.kt b/compiler/backend.common.jvm/src/org/jetbrains/kotlin/types/AbstractTypeMapper.kt index 0a8f7e324a5..d7ca0d4d50e 100644 --- a/compiler/backend.common.jvm/src/org/jetbrains/kotlin/types/AbstractTypeMapper.kt +++ b/compiler/backend.common.jvm/src/org/jetbrains/kotlin/types/AbstractTypeMapper.kt @@ -8,6 +8,7 @@ package org.jetbrains.kotlin.types import org.jetbrains.kotlin.codegen.AsmUtil import org.jetbrains.kotlin.codegen.signature.AsmTypeFactory import org.jetbrains.kotlin.load.kotlin.JvmDescriptorTypeWriter +import org.jetbrains.kotlin.load.kotlin.NON_EXISTENT_CLASS_NAME import org.jetbrains.kotlin.load.kotlin.TypeMappingMode import org.jetbrains.kotlin.load.kotlin.mapBuiltInType import org.jetbrains.kotlin.resolve.jvm.AsmTypes @@ -56,6 +57,12 @@ object AbstractTypeMapper { mode: TypeMappingMode = TypeMappingMode.DEFAULT, sw: Writer? = null ): Type { + if (type.isError()) { + val jvmType = Type.getObjectType(NON_EXISTENT_CLASS_NAME) + with(context) { sw?.writeGenericType(type, jvmType, mode) } + return jvmType + } + val typeConstructor = type.typeConstructor() if (type is SimpleTypeMarker) { diff --git a/compiler/ir/backend.jvm/codegen/src/org/jetbrains/kotlin/backend/jvm/codegen/AnnotationCodegen.kt b/compiler/ir/backend.jvm/codegen/src/org/jetbrains/kotlin/backend/jvm/codegen/AnnotationCodegen.kt index 30680675ca0..b021d3e1167 100644 --- a/compiler/ir/backend.jvm/codegen/src/org/jetbrains/kotlin/backend/jvm/codegen/AnnotationCodegen.kt +++ b/compiler/ir/backend.jvm/codegen/src/org/jetbrains/kotlin/backend/jvm/codegen/AnnotationCodegen.kt @@ -216,7 +216,7 @@ abstract class AnnotationCodegen( genCompileTimeValue(getAnnotationArgumentJvmName(annotationClass, param.name), value, annotationVisitor) else if (param.defaultValue != null) continue // Default value will be supplied by JVM at runtime. - else + else if (context.state.classBuilderMode.generateBodies) //skip error for KAPT error("No value for annotation parameter $param") } } diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/ir/JvmIrTypeUtils.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/ir/JvmIrTypeUtils.kt index e57fcca9fcc..900520f5633 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/ir/JvmIrTypeUtils.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/ir/JvmIrTypeUtils.kt @@ -89,7 +89,7 @@ val IrType.erasedUpperBound: IrClass is IrClassSymbol -> classifier.owner is IrTypeParameterSymbol -> classifier.owner.erasedUpperBound is IrScriptSymbol -> classifier.owner.targetClass!!.owner - else -> error(render()) + else -> if (this is IrErrorType) symbol.owner else error(render()) } /** diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/mapping/IrTypeMapper.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/mapping/IrTypeMapper.kt index 3eed8c597b7..3a51b87ca8c 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/mapping/IrTypeMapper.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/mapping/IrTypeMapper.kt @@ -132,6 +132,11 @@ class IrTypeMapper(private val context: JvmBackendContext) : KotlinTypeMapperBas ): Type = AbstractTypeMapper.mapType(this, type, mode, sw) override fun JvmSignatureWriter.writeGenericType(type: KotlinTypeMarker, asmType: Type, mode: TypeMappingMode) { + if (type is IrErrorType) { + writeAsmType(asmType) + return + } + if (type !is IrSimpleType) return if (skipGenericSignature() || hasNothingInNonContravariantPosition(type) || type.arguments.isEmpty() || type.isRawTypeImpl()) { writeAsmType(asmType) diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin.kt index b305fda4116..cffec99443c 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin.kt @@ -31,6 +31,7 @@ interface IrDeclarationOrigin { object FILE_CLASS : IrDeclarationOriginImpl("FILE_CLASS") object SYNTHETIC_FILE_CLASS : IrDeclarationOriginImpl("SYNTHETIC_FILE_CLASS", isSynthetic = true) object JVM_MULTIFILE_CLASS : IrDeclarationOriginImpl("JVM_MULTIFILE_CLASS") + object ERROR_CLASS : IrDeclarationOriginImpl("ERROR_CLASS") object SCRIPT_CLASS : IrDeclarationOriginImpl("SCRIPT_CLASS") object SCRIPT_STATEMENT : IrDeclarationOriginImpl("SCRIPT_STATEMENT") diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/descriptors/IrBasedDescriptors.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/descriptors/IrBasedDescriptors.kt index a599701fe56..ac67388ca7a 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/descriptors/IrBasedDescriptors.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/descriptors/IrBasedDescriptors.kt @@ -1138,6 +1138,7 @@ fun IrType.toIrBasedKotlinType(): KotlinType = when (this) { it } } + is IrErrorType -> kotlinType ?: error("Can't find KotlinType in IrErrorType: " + (this as IrType).render()) else -> throw AssertionError("Unexpected type: $this = ${this.render()}") } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/IrType.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/IrType.kt index d8d3fef0406..58496bdd2e5 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/IrType.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/IrType.kt @@ -6,6 +6,7 @@ package org.jetbrains.kotlin.ir.types import org.jetbrains.kotlin.ir.declarations.IrAnnotationContainer +import org.jetbrains.kotlin.ir.symbols.IrClassSymbol import org.jetbrains.kotlin.ir.symbols.IrClassifierSymbol import org.jetbrains.kotlin.ir.symbols.IrTypeAliasSymbol import org.jetbrains.kotlin.ir.types.impl.IrTypeBase @@ -28,7 +29,10 @@ abstract class IrType : KotlinTypeMarker, IrAnnotationContainer { abstract override fun hashCode(): Int } -abstract class IrErrorType(kotlinType: KotlinType?) : IrTypeBase(kotlinType) +abstract class IrErrorType(kotlinType: KotlinType?, private val errorClassStubSymbol: IrClassSymbol) : IrTypeBase(kotlinType), SimpleTypeMarker { + val symbol: IrClassSymbol + get() = errorClassStubSymbol +} abstract class IrDynamicType(kotlinType: KotlinType?) : IrTypeBase(kotlinType), DynamicTypeMarker diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/IrTypeSystemContext.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/IrTypeSystemContext.kt index cf28656c9dc..e69884ddbd4 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/IrTypeSystemContext.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/IrTypeSystemContext.kt @@ -86,6 +86,7 @@ interface IrTypeSystemContext : TypeSystemContext, TypeSystemCommonSuperTypesCon override fun SimpleTypeMarker.typeConstructor(): TypeConstructorMarker = when (this) { is IrCapturedType -> constructor is IrSimpleType -> classifier + is IrErrorType -> symbol else -> error("Unknown type constructor") } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/impl/IrTypeBase.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/impl/IrTypeBase.kt index 83476db32e2..5d17ba41fdf 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/impl/IrTypeBase.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/impl/IrTypeBase.kt @@ -5,11 +5,26 @@ package org.jetbrains.kotlin.ir.types.impl -import org.jetbrains.kotlin.ir.declarations.IrFunction -import org.jetbrains.kotlin.ir.declarations.IrTypeParameter +import org.jetbrains.kotlin.descriptors.ClassKind +import org.jetbrains.kotlin.descriptors.DescriptorVisibilities +import org.jetbrains.kotlin.descriptors.Modality +import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor +import org.jetbrains.kotlin.ir.IrFileEntry +import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI +import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET +import org.jetbrains.kotlin.ir.declarations.* +import org.jetbrains.kotlin.ir.declarations.impl.IrClassImpl +import org.jetbrains.kotlin.ir.declarations.impl.IrValueParameterImpl import org.jetbrains.kotlin.ir.expressions.IrConstructorCall import org.jetbrains.kotlin.ir.symbols.IrClassifierSymbol +import org.jetbrains.kotlin.ir.symbols.IrFileSymbol +import org.jetbrains.kotlin.ir.symbols.IrValueParameterSymbol +import org.jetbrains.kotlin.ir.symbols.impl.IrClassSymbolImpl +import org.jetbrains.kotlin.ir.symbols.impl.IrValueParameterSymbolImpl import org.jetbrains.kotlin.ir.types.* +import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.name.SpecialNames import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.Variance import org.jetbrains.kotlin.types.model.CaptureStatus @@ -25,12 +40,46 @@ class IrErrorTypeImpl( kotlinType: KotlinType?, override val annotations: List, override val variance: Variance, -) : IrErrorType(kotlinType) { +) : IrErrorType(kotlinType, IrErrorClassImpl.symbol) { override fun equals(other: Any?): Boolean = other is IrErrorTypeImpl override fun hashCode(): Int = IrErrorTypeImpl::class.java.hashCode() } +object IrErrorClassImpl : IrClassImpl( + UNDEFINED_OFFSET, UNDEFINED_OFFSET, IrDeclarationOrigin.ERROR_CLASS, IrClassSymbolImpl(), + Name.special(""), ClassKind.CLASS, DescriptorVisibilities.DEFAULT_VISIBILITY, Modality.FINAL +) { + override var parent: IrDeclarationParent + get() = object: IrFile() { + override val startOffset: Int + get() = TODO("Not yet implemented") + override val endOffset: Int + get() = TODO("Not yet implemented") + override var annotations: List + get() = TODO("Not yet implemented") + set(_) {} + override val declarations: MutableList + get() = TODO("Not yet implemented") + override val symbol: IrFileSymbol + get() = TODO("Not yet implemented") + override val module: IrModuleFragment + get() = TODO("Not yet implemented") + override val fileEntry: IrFileEntry + get() = TODO("Not yet implemented") + override var metadata: MetadataSource? + get() = TODO("Not yet implemented") + set(_) {} + + @ObsoleteDescriptorBasedAPI + override val packageFragmentDescriptor: PackageFragmentDescriptor + get() = TODO("Not yet implemented") + override val fqName: FqName + get() = FqName.ROOT + } + set(_) = TODO() +} + class IrDynamicTypeImpl( kotlinType: KotlinType?, override val annotations: List, diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/IrUtils.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/IrUtils.kt index 07f4dab55bd..8e92a1f8ef6 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/IrUtils.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/IrUtils.kt @@ -24,6 +24,7 @@ import org.jetbrains.kotlin.ir.types.* import org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeImpl import org.jetbrains.kotlin.ir.types.impl.makeTypeProjection import org.jetbrains.kotlin.ir.visitors.IrElementVisitor +import org.jetbrains.kotlin.ir.types.impl.IrErrorClassImpl import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.name.SpecialNames diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/TypeTranslator.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/TypeTranslator.kt index c64d71564f6..d011e80fc65 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/TypeTranslator.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/TypeTranslator.kt @@ -95,7 +95,11 @@ abstract class TypeTranslator( when { approximatedType.isError -> - return IrErrorTypeImpl(approximatedType, translateTypeAnnotations(approximatedType), variance) + return IrErrorTypeImpl( + approximatedType, + translateTypeAnnotations(approximatedType), + variance, + ) approximatedType.isDynamic() -> return IrDynamicTypeImpl(approximatedType, translateTypeAnnotations(approximatedType), variance) supportDefinitelyNotNullTypes && approximatedType is DefinitelyNotNullType -> diff --git a/plugins/kapt3/kapt3-compiler/src/org/jetbrains/kotlin/kapt3/stubs/ClassFileToSourceStubConverter.kt b/plugins/kapt3/kapt3-compiler/src/org/jetbrains/kotlin/kapt3/stubs/ClassFileToSourceStubConverter.kt index 136844e6d5e..9cc7dc4ef93 100644 --- a/plugins/kapt3/kapt3-compiler/src/org/jetbrains/kotlin/kapt3/stubs/ClassFileToSourceStubConverter.kt +++ b/plugins/kapt3/kapt3-compiler/src/org/jetbrains/kotlin/kapt3/stubs/ClassFileToSourceStubConverter.kt @@ -1009,13 +1009,14 @@ class ClassFileToSourceStubConverter(val kaptContext: KaptContextForStubGenerati parameters: JavacList, valueParametersFromDescriptor: List ): Pair { + val psiElement = kaptContext.origins[method]?.element val genericSignature = signatureParser.parseMethodSignature( method.signature, parameters, exceptionTypes, jcReturnType, nonErrorParameterTypeProvider = { index, lazyType -> if (descriptor is PropertySetterDescriptor && valueParametersFromDescriptor.size == 1 && index == 0) { getNonErrorType(descriptor.correspondingProperty.returnType, METHOD_PARAMETER_TYPE, ktTypeProvider = { - val setterOrigin = (kaptContext.origins[method]?.element as? KtCallableDeclaration) + val setterOrigin = (psiElement as? KtCallableDeclaration) ?.takeIf { it !is KtFunction } setterOrigin?.typeReference @@ -1023,7 +1024,11 @@ class ClassFileToSourceStubConverter(val kaptContext: KaptContextForStubGenerati ifNonError = { lazyType() }) } else if (descriptor is FunctionDescriptor && valueParametersFromDescriptor.size == parameters.size) { val parameterDescriptor = valueParametersFromDescriptor[index] - val sourceElement = kaptContext.origins[method]?.element as? KtFunction + val sourceElement = when { + psiElement is KtFunction -> psiElement + descriptor is ConstructorDescriptor && descriptor.isPrimary -> (psiElement as? KtClassOrObject)?.primaryConstructor + else -> null + } getNonErrorType( parameterDescriptor.type, METHOD_PARAMETER_TYPE, @@ -1047,11 +1052,11 @@ class ClassFileToSourceStubConverter(val kaptContext: KaptContextForStubGenerati val returnType = getNonErrorType( descriptor.returnType, RETURN_TYPE, ktTypeProvider = { - when (val element = kaptContext.origins[method]?.element) { - is KtFunction -> element.typeReference - is KtProperty -> if (descriptor is PropertyGetterDescriptor) element.typeReference else null - is KtPropertyAccessor -> if (descriptor is PropertyGetterDescriptor) element.property.typeReference else null - is KtParameter -> if (descriptor is PropertyGetterDescriptor) element.typeReference else null + when (psiElement) { + is KtFunction -> psiElement.typeReference + is KtProperty -> if (descriptor is PropertyGetterDescriptor) psiElement.typeReference else null + is KtPropertyAccessor -> if (descriptor is PropertyGetterDescriptor) psiElement.property.typeReference else null + is KtParameter -> if (descriptor is PropertyGetterDescriptor) psiElement.typeReference else null else -> null } }, diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/errorLocationMapping.kt b/plugins/kapt3/kapt3-compiler/testData/converter/errorLocationMapping.kt index 1b989edd627..3e914d7114f 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/errorLocationMapping.kt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/errorLocationMapping.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // CORRECT_ERROR_TYPES @file:Suppress("UNRESOLVED_REFERENCE", "ANNOTATION_ARGUMENT_MUST_BE_CONST", "NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION") @@ -28,6 +27,6 @@ class ErrorInDeclarations { annotation class Anno(val a: KClass) +// EXPECTED_ERROR(kotlin:11:1) cannot find symbol +// EXPECTED_ERROR(kotlin:6:1) cannot find symbol // EXPECTED_ERROR(kotlin:12:1) cannot find symbol -// EXPECTED_ERROR(kotlin:7:1) cannot find symbol -// EXPECTED_ERROR(kotlin:13:1) cannot find symbol diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclassCorrectErrorTypes.kt b/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclassCorrectErrorTypes.kt index 7530ebe5adc..5b640b77d9e 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclassCorrectErrorTypes.kt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclassCorrectErrorTypes.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // CORRECT_ERROR_TYPES // NO_VALIDATION // WITH_STDLIB diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/importsKt22083.kt b/plugins/kapt3/kapt3-compiler/testData/converter/importsKt22083.kt index 8d326e87015..8d4371c31c4 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/importsKt22083.kt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/importsKt22083.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // CORRECT_ERROR_TYPES // FILE: a.kt @@ -53,4 +52,4 @@ interface TestC { fun e(): LibFooBar } -// EXPECTED_ERROR(kotlin:17:5) cannot find symbol +// EXPECTED_ERROR(kotlin:16:5) cannot find symbol diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/leadingDollars2.kt b/plugins/kapt3/kapt3-compiler/testData/converter/leadingDollars2.kt index 81c70d629e2..63920ce2ba8 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/leadingDollars2.kt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/leadingDollars2.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // CORRECT_ERROR_TYPES // FILE: te/st/a/JavaClass diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/maxErrorCount.kt b/plugins/kapt3/kapt3-compiler/testData/converter/maxErrorCount.kt index 9a29ef1ac92..82729690895 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/maxErrorCount.kt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/maxErrorCount.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // CORRECT_ERROR_TYPES // JAVAC_OPTION -Xmaxerrs=1 @@ -12,4 +11,4 @@ class Test { // There are two errors (unresolved identifier ABC, BCD) actually. // But we specified the max error count, so the error output is limited. -// EXPECTED_ERROR(kotlin:8:5) cannot find symbol +// EXPECTED_ERROR(kotlin:7:5) cannot find symbol diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClass.kt b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClass.kt index 00b1e198996..983786e8d66 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClass.kt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // CORRECT_ERROR_TYPES // NON_EXISTENT_CLASS // NO_VALIDATION diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassWIthoutCorrection.kt b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassWIthoutCorrection.kt index f18024ba095..74673d53507 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassWIthoutCorrection.kt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassWIthoutCorrection.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // NON_EXISTENT_CLASS // NO_VALIDATION diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassWIthoutCorrection_ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassWIthoutCorrection_ir.txt new file mode 100644 index 00000000000..fbdd5cb069f --- /dev/null +++ b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassWIthoutCorrection_ir.txt @@ -0,0 +1,129 @@ +import java.lang.System; + +@kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) +@kotlin.Metadata() +public final class NonExistentClassWIthoutCorrectionKt { +} + +//////////////////// + + +import java.lang.System; + +@kotlin.Metadata() +public final class NonExistentType { + @org.jetbrains.annotations.Nullable() + private static final error.NonExistentClass a = null; + @org.jetbrains.annotations.Nullable() + private static final java.util.List b = null; + @org.jetbrains.annotations.NotNull() + private static final kotlin.jvm.functions.Function1 c = null; + @org.jetbrains.annotations.Nullable() + private static final error.NonExistentClass d = null; + public static java.lang.String string2; + public static error.NonExistentClass coocoo; + public static error.NonExistentClass coocoo2; + public static error.NonExistentClass coocoo21; + public static error.NonExistentClass coocoo3; + public static error.NonExistentClass coocoo31; + @org.jetbrains.annotations.NotNull() + public static final NonExistentType INSTANCE = null; + + private NonExistentType() { + super(); + } + + @org.jetbrains.annotations.Nullable() + public final error.NonExistentClass getA() { + return null; + } + + @org.jetbrains.annotations.Nullable() + public final java.util.List getB() { + return null; + } + + @org.jetbrains.annotations.NotNull() + public final kotlin.jvm.functions.Function1 getC() { + return null; + } + + @org.jetbrains.annotations.Nullable() + public final error.NonExistentClass getD() { + return null; + } + + @org.jetbrains.annotations.NotNull() + public final java.lang.String getString2() { + return null; + } + + public final void setString2(@org.jetbrains.annotations.NotNull() + java.lang.String p0) { + } + + @org.jetbrains.annotations.NotNull() + public final error.NonExistentClass getCoocoo() { + return null; + } + + public final void setCoocoo(@org.jetbrains.annotations.NotNull() + error.NonExistentClass p0) { + } + + @org.jetbrains.annotations.NotNull() + public final error.NonExistentClass getCoocoo2() { + return null; + } + + public final void setCoocoo2(@org.jetbrains.annotations.NotNull() + error.NonExistentClass p0) { + } + + @org.jetbrains.annotations.NotNull() + public final error.NonExistentClass getCoocoo21() { + return null; + } + + public final void setCoocoo21(@org.jetbrains.annotations.NotNull() + error.NonExistentClass p0) { + } + + @org.jetbrains.annotations.NotNull() + public final error.NonExistentClass getCoocoo3() { + return null; + } + + public final void setCoocoo3(@org.jetbrains.annotations.NotNull() + error.NonExistentClass p0) { + } + + @org.jetbrains.annotations.NotNull() + public final error.NonExistentClass getCoocoo31() { + return null; + } + + public final void setCoocoo31(@org.jetbrains.annotations.NotNull() + error.NonExistentClass p0) { + } + + @org.jetbrains.annotations.NotNull() + public final error.NonExistentClass a(@org.jetbrains.annotations.NotNull() + error.NonExistentClass a, @org.jetbrains.annotations.NotNull() + java.lang.String s) { + return null; + } + + @org.jetbrains.annotations.NotNull() + public final error.NonExistentClass b(@org.jetbrains.annotations.NotNull() + java.lang.String s) { + return null; + } +} + +//////////////////// + +package error; + +public final class NonExistentClass { +} diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClass_ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClass_ir.txt new file mode 100644 index 00000000000..2e8926b5bf5 --- /dev/null +++ b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClass_ir.txt @@ -0,0 +1,65 @@ +import java.lang.System; + +@kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) +@kotlin.Metadata() +public final class NonExistentType { + @org.jetbrains.annotations.Nullable() + private static final ABCDEF a = null; + @org.jetbrains.annotations.Nullable() + private static final java.util.List b = null; + @org.jetbrains.annotations.NotNull() + private static final Function1 c = null; + @org.jetbrains.annotations.Nullable() + private static final ABCDEF, kotlin.Unit>> d = null; + @org.jetbrains.annotations.NotNull() + public static final NonExistentType INSTANCE = null; + + private NonExistentType() { + super(); + } + + @org.jetbrains.annotations.Nullable() + public final ABCDEF getA() { + return null; + } + + @org.jetbrains.annotations.Nullable() + public final java.util.List getB() { + return null; + } + + @org.jetbrains.annotations.NotNull() + public final Function1 getC() { + return null; + } + + @org.jetbrains.annotations.Nullable() + public final ABCDEF, kotlin.Unit>> getD() { + return null; + } + + @org.jetbrains.annotations.NotNull() + public final Foo getFoo() { + return null; + } + + @org.jetbrains.annotations.NotNull() + public final ABCDEF a(@org.jetbrains.annotations.NotNull() + ABCDEF a, @org.jetbrains.annotations.NotNull() + java.lang.String s) { + return null; + } + + @org.jetbrains.annotations.NotNull() + public final ABCDEF b(@org.jetbrains.annotations.NotNull() + java.lang.String s) { + return null; + } +} + +//////////////////// + +package error; + +public final class NonExistentClass { +}