Implement strict and lenient modes for Kotlin metadata reading
In strict mode, an exception will be thrown when inconsistent metadata is encountered. In lenient mode, the reader will attempt to handle the inconsistent metadata by ignoring certain inconsistencies. This is a solution to a problem of reading metadata 'from the future' that is not allowed by default, but desired in certain cases. See updated ReadMe for details. Also fix problem with Strict Semantics flag. #KT-57922 Fixed #KT-59441 Fixed
This commit is contained in:
committed by
Space Team
parent
e048d49bf0
commit
36703ff9ae
@@ -28,7 +28,7 @@ fun abiMetadataProcessor(annotationVisitor: AnnotationVisitor): AnnotationVisito
|
||||
} ?: intArrayOf(1, 4)
|
||||
|
||||
val newHeader = runCatching {
|
||||
when (val metadata = KotlinClassMetadata.read(header)) {
|
||||
when (val metadata = KotlinClassMetadata.readStrict(header)) {
|
||||
is KotlinClassMetadata.Class -> {
|
||||
val klass = metadata.kmClass
|
||||
klass.removePrivateDeclarations()
|
||||
|
||||
Reference in New Issue
Block a user