From 4e9a1ef9259a84a5b7e235238991535a7f1f321d Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Thu, 29 Aug 2024 18:26:10 +0100 Subject: [PATCH] KE2: Start extracting functions --- .../src/main/kotlin/KotlinFileExtractor.kt | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/java/kotlin-extractor2/src/main/kotlin/KotlinFileExtractor.kt b/java/kotlin-extractor2/src/main/kotlin/KotlinFileExtractor.kt index 1e24f86673d..222d63bf0c2 100644 --- a/java/kotlin-extractor2/src/main/kotlin/KotlinFileExtractor.kt +++ b/java/kotlin-extractor2/src/main/kotlin/KotlinFileExtractor.kt @@ -286,19 +286,22 @@ OLD: KE1 } is KtFunction -> { val parentId = useDeclarationParentOf(declaration, false)?.cast() -/* -OLD: KE1 if (parentId != null) { extractFunction( declaration, parentId, +/* +OLD: KE1 extractBody = extractFunctionBodies, extractMethodAndParameterTypeAccesses = extractFunctionBodies, extractAnnotations = extractAnnotations, null, listOf() +*/ ) } +/* +OLD: KE1 Unit */ } @@ -1786,16 +1789,23 @@ OLD: KE1 } } } +*/ private fun extractFunction( - f: IrFunction, + f: KtFunction, parentId: Label, +/* +OLD: KE1 extractBody: Boolean, extractMethodAndParameterTypeAccesses: Boolean, extractAnnotations: Boolean, typeSubstitution: TypeSubstitution?, classTypeArgsIncludingOuterClasses: List? +*/ ) = + null // TODO +/* +OLD: KE1 if (isFake(f)) { if (needsInterfaceForwarder(f)) makeInterfaceForwarder( @@ -1808,6 +1818,9 @@ OLD: KE1 ) else null } else { +*/ +/* +OLD: KE1 // Work around an apparent bug causing redeclarations of `fun toString(): String` // specifically in interfaces loaded from Java classes show up like fake overrides. val overriddenVisibility = @@ -1845,7 +1858,10 @@ OLD: KE1 ) } } +*/ +/* +OLD: KE1 private fun extractDefaultsFunction( f: IrFunction, parentId: Label,