@@ -499,8 +499,14 @@ class KotlinFileExtractor(val logger: Logger, val tw: TrapWriter) {
499499 tw.writeHasLocation(id, locId)
500500 id
501501 } else -> {
502- logger.warn(" Unrecognised IrCall: " + c.render())
503- return
502+ val id = tw.getFreshIdLabel<DbMethodaccess >()
503+ val typeId = useType(c.type)
504+ val locId = tw.getLocation(c.startOffset, c.endOffset)
505+ val methodId = useFunction(c.symbol.owner)
506+ tw.writeExprs_methodaccess(id, typeId, parent, idx)
507+ tw.writeHasLocation(id, locId)
508+ tw.writeCallableBinding(id, methodId)
509+ id
504510 }
505511 }
506512 val dr = c.dispatchReceiver
@@ -560,14 +566,23 @@ class KotlinFileExtractor(val logger: Logger, val tw: TrapWriter) {
560566 }
561567 }
562568 is IrGetValue -> {
563- val id = tw.getFreshIdLabel<DbVaraccess >()
564- val typeId = useType(e.type)
565- val locId = tw.getLocation(e.startOffset, e.endOffset)
566- tw.writeExprs_varaccess(id, typeId, parent, idx)
567- tw.writeHasLocation(id, locId)
568-
569- val vId = useValueDeclaration(e.symbol.owner)
570- tw.writeVariableBinding(id, vId)
569+ val owner = e.symbol.owner
570+ if (owner is IrValueParameter && owner.index == - 1 ) {
571+ val id = tw.getFreshIdLabel<DbThisaccess >()
572+ val typeId = useType(e.type)
573+ val locId = tw.getLocation(e.startOffset, e.endOffset)
574+ tw.writeExprs_thisaccess(id, typeId, parent, idx)
575+ tw.writeHasLocation(id, locId)
576+ } else {
577+ val id = tw.getFreshIdLabel<DbVaraccess >()
578+ val typeId = useType(e.type)
579+ val locId = tw.getLocation(e.startOffset, e.endOffset)
580+ tw.writeExprs_varaccess(id, typeId, parent, idx)
581+ tw.writeHasLocation(id, locId)
582+
583+ val vId = useValueDeclaration(owner)
584+ tw.writeVariableBinding(id, vId)
585+ }
571586 }
572587 is IrSetValue -> {
573588 val id = tw.getFreshIdLabel<DbAssignexpr >()
0 commit comments