@@ -1175,26 +1175,6 @@ open class KotlinFileExtractor(
11751175 return FieldResult (instanceId, instanceName)
11761176 }
11771177
1178- private fun isQualifiedThis (vp : IrValueParameter ): Boolean {
1179- return isQualifiedThisFunction(vp) ||
1180- isQualifiedThisClass(vp)
1181- }
1182-
1183- private fun isQualifiedThisFunction (vp : IrValueParameter ): Boolean {
1184- val parent = vp.parent
1185- return vp.index == - 1 &&
1186- parent is IrFunction &&
1187- parent.dispatchReceiverParameter == vp &&
1188- parent.extensionReceiverParameter != null
1189- }
1190-
1191- private fun isQualifiedThisClass (vp : IrValueParameter ): Boolean {
1192- val parent = vp.parent
1193- return vp.index == - 1 &&
1194- parent is IrClass &&
1195- parent.thisReceiver == vp
1196- }
1197-
11981178 fun extractValueParameter (vp : IrValueParameter , parent : Label <out DbCallable >, idx : Int ) {
11991179 val id = useValueParameter(vp)
12001180 val type = useType(vp.type)
@@ -1896,12 +1876,31 @@ open class KotlinFileExtractor(
18961876 val type = useType(e.type)
18971877 val locId = tw.getLocation(e)
18981878 tw.writeExprs_thisaccess(id, type.javaResult.id, type.kotlinResult.id, exprParent.parent, exprParent.idx)
1899- if (isQualifiedThis(owner)) {
1900- // todo: add type access as child of 'id' at index 0
1901- logger.warnElement(Severity .ErrorSevere , " TODO: Qualified this access found." , e)
1902- }
19031879 tw.writeHasLocation(id, locId)
19041880 tw.writeCallableEnclosingExpr(id, callable)
1881+
1882+ val ownerParent = owner.parent
1883+ when (ownerParent) {
1884+ is IrFunction -> {
1885+ if (ownerParent.dispatchReceiverParameter == owner &&
1886+ ownerParent.extensionReceiverParameter != null ) {
1887+ logger.warnElement(Severity .ErrorSevere , " Function-qualifier for this" , e)
1888+ }
1889+ }
1890+ is IrClass -> {
1891+ if (ownerParent.thisReceiver == owner) {
1892+ val qualId = tw.getFreshIdLabel<DbUnannotatedtypeaccess >()
1893+ // TODO: Type arguments
1894+ val qualType = useSimpleTypeClass(ownerParent, listOf (), false )
1895+ tw.writeExprs_unannotatedtypeaccess(qualId, qualType.javaResult.id, qualType.kotlinResult.id, id, 0 )
1896+ tw.writeHasLocation(qualId, locId)
1897+ tw.writeCallableEnclosingExpr(qualId, callable)
1898+ }
1899+ }
1900+ else -> {
1901+ logger.warnElement(Severity .ErrorSevere , " Unexpected owner parent for this access: " + ownerParent.javaClass, e)
1902+ }
1903+ }
19051904 } else {
19061905 val id = tw.getFreshIdLabel<DbVaraccess >()
19071906 val type = useType(e.type)
0 commit comments