diff --git a/java/kotlin-extractor/src/main/kotlin/KotlinExtractorExtension.kt b/java/kotlin-extractor/src/main/kotlin/KotlinExtractorExtension.kt index 9634a817f0f..0355ae6831c 100644 --- a/java/kotlin-extractor/src/main/kotlin/KotlinExtractorExtension.kt +++ b/java/kotlin-extractor/src/main/kotlin/KotlinExtractorExtension.kt @@ -879,7 +879,7 @@ open class KotlinFileExtractor( c.typeParameters.map { extractTypeParameter(it) } c.declarations.map { extractDeclaration(it, id) } extractObjectInitializerFunction(c, id) - if(c.isObject) { + if(c.isNonCompanionObject) { // For `object MyObject { ... }`, the .class has an // automatically-generated `public static final MyObject INSTANCE` // field that may be referenced from Java code, and is used in our @@ -900,7 +900,7 @@ open class KotlinFileExtractor( data class ObjectClassInstance(val id: Label, val name: String) fun useObjectClassInstance(c: IrClass): ObjectClassInstance { - if(!c.isObject) { + if(!c.isNonCompanionObject) { logger.warn(Severity.ErrorSevere, "Using instance for non-object class") } val classId = useClassSource(c) diff --git a/java/ql/test/kotlin/library-tests/types/types.expected b/java/ql/test/kotlin/library-tests/types/types.expected index e492639813b..c1071a23996 100644 --- a/java/ql/test/kotlin/library-tests/types/types.expected +++ b/java/ql/test/kotlin/library-tests/types/types.expected @@ -421,7 +421,6 @@ | file://:0:0:0:0 | BinaryOperator | Interface, ParameterizedType | | file://:0:0:0:0 | Boolean | Class | | file://:0:0:0:0 | Boolean | Class | -| file://:0:0:0:0 | BooleanCompanionObject | Class | | file://:0:0:0:0 | BooleanSignature | Class | | file://:0:0:0:0 | BottomSignature | Class | | file://:0:0:0:0 | BoundMethodHandle | Class | @@ -578,7 +577,6 @@ | file://:0:0:0:0 | Char | Class | | file://:0:0:0:0 | CharArray | Class | | file://:0:0:0:0 | CharBuffer | Class | -| file://:0:0:0:0 | CharCompanionObject | Class | | file://:0:0:0:0 | CharIterator | Class | | file://:0:0:0:0 | CharProgression | Class | | file://:0:0:0:0 | CharRange | Class | @@ -1120,7 +1118,6 @@ | file://:0:0:0:0 | DoubleArray | Class | | file://:0:0:0:0 | DoubleBinaryOperator | Interface | | file://:0:0:0:0 | DoubleBuffer | Class | -| file://:0:0:0:0 | DoubleCompanionObject | Class | | file://:0:0:0:0 | DoubleConsumer | Interface | | file://:0:0:0:0 | DoubleFunction | GenericType, Interface, ParameterizedType | | file://:0:0:0:0 | DoubleFunction | Interface, ParameterizedType | @@ -1294,7 +1291,6 @@ | file://:0:0:0:0 | Enum | Class, ParameterizedType | | file://:0:0:0:0 | Enum | Class, ParameterizedType | | file://:0:0:0:0 | Enum | Class, ParameterizedType | -| file://:0:0:0:0 | EnumCompanionObject | Class | | file://:0:0:0:0 | EnumSet | Class, GenericType, ParameterizedType | | file://:0:0:0:0 | EnumSet | Class, ParameterizedType | | file://:0:0:0:0 | EnumSet | Class, ParameterizedType | @@ -1616,7 +1612,6 @@ | file://:0:0:0:0 | IntArray | Class | | file://:0:0:0:0 | IntBinaryOperator | Interface | | file://:0:0:0:0 | IntBuffer | Class | -| file://:0:0:0:0 | IntCompanionObject | Class | | file://:0:0:0:0 | IntConsumer | Interface | | file://:0:0:0:0 | IntFunction | GenericType, Interface, ParameterizedType | | file://:0:0:0:0 | IntFunction | Interface, ParameterizedType | @@ -1921,7 +1916,6 @@ | file://:0:0:0:0 | LongArray | Class | | file://:0:0:0:0 | LongBinaryOperator | Interface | | file://:0:0:0:0 | LongBuffer | Class | -| file://:0:0:0:0 | LongCompanionObject | Class | | file://:0:0:0:0 | LongConsumer | Interface | | file://:0:0:0:0 | LongFunction | GenericType, Interface, ParameterizedType | | file://:0:0:0:0 | LongFunction | Interface, ParameterizedType | @@ -2547,7 +2541,6 @@ | file://:0:0:0:0 | String | Class | | file://:0:0:0:0 | StringBuffer | Class | | file://:0:0:0:0 | StringBuilder | Class | -| file://:0:0:0:0 | StringCompanionObject | Class | | file://:0:0:0:0 | Subject | Class | | file://:0:0:0:0 | Subset | Class | | file://:0:0:0:0 | SuppliedThreadLocal | Class, GenericType, ParameterizedType |