@@ -206,11 +206,12 @@ class KotlinFileExtractor(val tw: TrapWriter) {
206206 }
207207
208208 fun useClass (c : IrClass ): Label <out DbClass > {
209- if (c.name.asString() == " Unit " && tw.getExistingLabelFor< DbClass >(getClassLabel(c)) == null ) {
210- return extractClass(c)
211- } else {
212- return addClassLabel(c)
209+ if (c.name.asString() == " Any " || c.name.asString() == " Unit " ) {
210+ if (tw.getExistingLabelFor< DbClass >(getClassLabel(c)) == null ) {
211+ return extractClass(c)
212+ }
213213 }
214+ return addClassLabel(c)
214215 }
215216
216217 fun extractClass (c : IrClass ): Label <out DbClass > {
@@ -256,6 +257,15 @@ class KotlinFileExtractor(val tw: TrapWriter) {
256257 return id
257258 }
258259
260+ fun extractValueParameter (vp : IrValueParameter , parent : Label <out DbMethod >, idx : Int ) {
261+ val id = tw.getFreshIdLabel<DbParam >()
262+ val typeId = useType(vp.type)
263+ val locId = tw.getLocation(vp.startOffset, vp.endOffset)
264+ tw.writeParams(id, typeId, idx, parent, id)
265+ tw.writeHasLocation(id, locId)
266+ tw.writeParamName(id, vp.name.asString())
267+ }
268+
259269 fun extractFunction (f : IrFunction , parentid : Label <out DbPackage_or_reftype >) {
260270 val id = useFunction(f)
261271 val locId = tw.getLocation(f.startOffset, f.endOffset)
@@ -267,6 +277,9 @@ class KotlinFileExtractor(val tw: TrapWriter) {
267277 if (body != null ) {
268278 extractBody(body, id)
269279 }
280+ f.valueParameters.forEachIndexed { i, vp ->
281+ extractValueParameter(vp, id, i)
282+ }
270283 }
271284
272285 fun useProperty (p : IrProperty ): Label <out DbField > {
0 commit comments