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