Extract static method qualifier type accesses

This commit is contained in:
Chris Smowton
2021-12-16 18:48:06 +00:00
committed by Ian Lynagh
parent ef9a213ae1
commit 2730d07b4c
5 changed files with 25 additions and 0 deletions

View File

@@ -864,6 +864,8 @@ open class KotlinFileExtractor(
if (dr != null) {
extractExpressionExpr(dr, callable, id, -1, enclosingStmt)
} else if(callTarget.isStaticMethodOfClass) {
extractTypeAccess(callTarget.parentAsClass.toRawType(), callable, id, -1, c, enclosingStmt)
}
}

View File

@@ -172,4 +172,12 @@ fun IrType.toRawType(): IrType =
else -> this
}
fun IrClass.toRawType(): IrType {
val result = this.typeWith(listOf())
return if (this.typeParameters.isNotEmpty())
result.addAnnotations(listOf(RawTypeAnnotation.annotationConstructor))
else
result
}
typealias TypeSubstitution = (IrType, KotlinUsesExtractor.TypeContext, IrPluginContext) -> IrType