Rewrite KotlinP so it does not use visitors from kotlinx-metadata anymore;

fix bug with missing moduleName.
This commit is contained in:
Leonid Startsev
2022-09-20 18:37:43 +02:00
committed by Space Team
parent 3d679b76bc
commit c4d409608c
16 changed files with 451 additions and 729 deletions
@@ -1036,7 +1036,7 @@ class KmEffect(
*/
@ExperimentalContracts
@OptIn(DeprecatedVisitor::class)
class KmEffectExpression : KmEffectExpressionVisitor() {
class KmEffectExpression : KmEffectExpressionVisitor() {
/**
* Effect expression flags, consisting of [Flag.EffectExpression] flags.
*/
@@ -5,13 +5,11 @@
package org.jetbrains.kotlin.kotlinp
import kotlinx.metadata.DeprecatedVisitor
import kotlinx.metadata.InconsistentKotlinMetadataException
import kotlinx.metadata.jvm.KotlinClassMetadata
import kotlinx.metadata.jvm.KotlinModuleMetadata
import java.io.File
@OptIn(DeprecatedVisitor::class)
class Kotlinp(private val settings: KotlinpSettings) {
internal fun renderClassFile(classFile: KotlinClassMetadata?): String =
when (classFile) {
File diff suppressed because it is too large Load Diff
+2
View File
@@ -40,6 +40,8 @@ package {
context(B)
public final val h: kotlin/Int
public final /* non-default */ get
// module name: test-module
}
// META-INF/test-module.kotlin_module
// ------------------------------------------
+2
View File
@@ -63,6 +63,8 @@ package {
contract {
returns(true) implies (p#0 != null)
}
// module name: test-module
}
// META-INF/test-module.kotlin_module
// ------------------------------------------
@@ -48,6 +48,8 @@ package {
// local final /* delegated */ var d: kotlin/Any
// local final get
// local final set
// module name: test-module
}
// IntersectionTypeInLambdaLiteralAndDelegatedPropertyKt$test$1.class
// ------------------------------------------
+2
View File
@@ -4,6 +4,8 @@ package {
// signature: test()V
public final fun test(): kotlin/Unit
// module name: test-module
}
// LambdaKt$test$f$1.class
// ------------------------------------------
@@ -69,6 +69,8 @@ package {
// local delegated property #2
// local final /* delegated */ val local3: kotlin/CharSequence?
// local final get
// module name: test-module
}
// META-INF/test-module.kotlin_module
// ------------------------------------------
+2
View File
@@ -11,6 +11,8 @@ package {
// field: x:I
public final const val x: kotlin/Int /* = ... */
public final get
// module name: test-module
}
// META-INF/test-module.kotlin_module
// ------------------------------------------
@@ -4,6 +4,8 @@ package {
// signature: ok()V
public final fun ok(): kotlin/Unit
// module name: test-module
}
// META-INF/test-module.kotlin_module
// ------------------------------------------
+2
View File
@@ -14,6 +14,8 @@ package {
public typealias F<T#0 /* T */, T#1 /* U */> = kotlin/collections/Map<T#0, kotlin/Function1<kotlin/text/StringBuilder^, T#1?>> /* = kotlin/collections/Map<T#0, kotlin/Function1<java/lang/StringBuilder /* = kotlin/text/StringBuilder^ */, T#1?>> */
public typealias G<T#0 /* S */> = F^<kotlin/collections/List<T#0>, kotlin/collections/Set<T#0>> /* = kotlin/collections/Map<kotlin/collections/List<T#0>, kotlin/Function1<java/lang/StringBuilder /* = kotlin/text/StringBuilder^ */, kotlin/collections/Set<T#0>?>> */
// module name: test-module
}
// META-INF/test-module.kotlin_module
// ------------------------------------------
+2
View File
@@ -4,6 +4,8 @@ package {
// signature: f(Lkotlin/annotation/AnnotationTarget;)Ljava/lang/String;
public final fun f(a: kotlin/annotation/AnnotationTarget): kotlin/String?
// module name: test-module
}
// SyntheticClassKt$WhenMappings.class
// ------------------------------------------
@@ -35,6 +35,8 @@ package {
// requires API version 1.1.0 (level=HIDDEN, errorCode=314)
public typealias Typealias = kotlin/String /* = kotlin/String */
// module name: test-module
}
// META-INF/test-module.kotlin_module
// ------------------------------------------
@@ -4,6 +4,8 @@ package {
// signature: test()Ljava/lang/Runnable;
public final fun test(): java/lang/Runnable
// module name: test-module
}
// AnonymousObjectKt$test$1.class
// ------------------------------------------
@@ -4,6 +4,8 @@ package {
// signature: test()V
public final fun test(): kotlin/Unit
// module name: test-module
}
// DeepInnerLocalChainKt$test$Local.class
// ------------------------------------------
@@ -4,6 +4,8 @@ package {
// signature: test()V
public final fun test(): kotlin/Unit
// module name: test-module
}
// LocalClassInSignatureKt$test$Local.class
// ------------------------------------------