Skip to content

Conversation

qwwdfsad
Copy link
Member

@qwwdfsad qwwdfsad commented Jun 2, 2021

Parcelize bug explanation:

With Kotlin 1.4.x, the corresponding $Creator class has been generated properly as inner public class and his visibility was dominated by internal outer class

With Kotlin 1.5.0, $Creator is generated as local class within block. Local classes do not have the corresponding 'outer_class_info_index' attribute and thus their visibility cannot be dominated by the outer class. But they do not constitute public API anyway. The bug was in incorrect detection on whether the class is local.

Our isLocal check has been broken, but we had an additional guard in the code and also checked kotlinx.metadata.Flag.IS_LOCAL. Parcelize-generated classes lack such metadata and that guard also had failed

Fixes #55

Parcelize bug explanation:

With Kotlin 1.4.x, the corresponding $Creator class has been generated properly as inner public class and his visibility was generated by internal outer class

With Kotlin 1.5.0, $Creator is generated as local class within <clinit> block. Local classes do not have the corresponding 'outer_class_info_index' attribute and thus their visibility cannot be dominated by the outer class. But they do not constitute public API anyway. The bug was in incorrect detection on whether the class is local.

Our isLocal check has been broken, but we had an additional guard in the code and also checked kotlinx.metadata.Flag.IS_LOCAL. Parcelize-generated classes lack such metadata and that guard also had failed

Fixes #55
@qwwdfsad qwwdfsad requested a review from udalov June 3, 2021 08:34
@qwwdfsad qwwdfsad merged commit 5842109 into master Jun 4, 2021
@qwwdfsad qwwdfsad deleted the detect-local branch June 4, 2021 08:57
shanshin pushed a commit to JetBrains/kotlin that referenced this pull request Oct 28, 2024
Parcelize bug explanation:

With Kotlin 1.4.x, the corresponding $Creator class has been generated properly as an inner public class and its visibility was generated by internal outer class

With Kotlin 1.5.0, $Creator is generated as local class within <clinit> block. Local classes do not have the corresponding 'outer_class_info_index' attribute and thus their visibility cannot be dominated by the outer class. But they do not constitute public API anyway. The bug was in incorrect detection on whether the class is local.

Our isLocal check has been broken, but we had an additional guard in the code and also checked kotlinx.metadata.Flag.IS_LOCAL. Parcelize-generated classes lack such metadata and that guard also had failed

Fixes Kotlin/binary-compatibility-validator#55
Pull request Kotlin/binary-compatibility-validator#60
shanshin pushed a commit to JetBrains/kotlin that referenced this pull request Dec 3, 2024
Parcelize bug explanation:

With Kotlin 1.4.x, the corresponding $Creator class has been generated properly as an inner public class and its visibility was generated by internal outer class

With Kotlin 1.5.0, $Creator is generated as local class within <clinit> block. Local classes do not have the corresponding 'outer_class_info_index' attribute and thus their visibility cannot be dominated by the outer class. But they do not constitute public API anyway. The bug was in incorrect detection on whether the class is local.

Our isLocal check has been broken, but we had an additional guard in the code and also checked kotlinx.metadata.Flag.IS_LOCAL. Parcelize-generated classes lack such metadata and that guard also had failed

Fixes Kotlin/binary-compatibility-validator#55
Pull request Kotlin/binary-compatibility-validator#60
shanshin pushed a commit to JetBrains/kotlin that referenced this pull request Dec 13, 2024
Parcelize bug explanation:

With Kotlin 1.4.x, the corresponding $Creator class has been generated properly as an inner public class and its visibility was generated by internal outer class

With Kotlin 1.5.0, $Creator is generated as local class within <clinit> block. Local classes do not have the corresponding 'outer_class_info_index' attribute and thus their visibility cannot be dominated by the outer class. But they do not constitute public API anyway. The bug was in incorrect detection on whether the class is local.

Our isLocal check has been broken, but we had an additional guard in the code and also checked kotlinx.metadata.Flag.IS_LOCAL. Parcelize-generated classes lack such metadata and that guard also had failed

Fixes Kotlin/binary-compatibility-validator#55
Pull request Kotlin/binary-compatibility-validator#60
shanshin pushed a commit to JetBrains/kotlin that referenced this pull request Dec 23, 2024
Parcelize bug explanation:

With Kotlin 1.4.x, the corresponding $Creator class has been generated properly as an inner public class and its visibility was generated by internal outer class

With Kotlin 1.5.0, $Creator is generated as local class within <clinit> block. Local classes do not have the corresponding 'outer_class_info_index' attribute and thus their visibility cannot be dominated by the outer class. But they do not constitute public API anyway. The bug was in incorrect detection on whether the class is local.

Our isLocal check has been broken, but we had an additional guard in the code and also checked kotlinx.metadata.Flag.IS_LOCAL. Parcelize-generated classes lack such metadata and that guard also had failed

Fixes Kotlin/binary-compatibility-validator#55
Pull request Kotlin/binary-compatibility-validator#60

Moved from Kotlin/binary-compatibility-validator@5842109
KotlinBuild pushed a commit to JetBrains/kotlin that referenced this pull request Jan 3, 2025
Parcelize bug explanation:

With Kotlin 1.4.x, the corresponding $Creator class has been generated properly as an inner public class and its visibility was generated by internal outer class

With Kotlin 1.5.0, $Creator is generated as local class within <clinit> block. Local classes do not have the corresponding 'outer_class_info_index' attribute and thus their visibility cannot be dominated by the outer class. But they do not constitute public API anyway. The bug was in incorrect detection on whether the class is local.

Our isLocal check has been broken, but we had an additional guard in the code and also checked kotlinx.metadata.Flag.IS_LOCAL. Parcelize-generated classes lack such metadata and that guard also had failed

Fixes Kotlin/binary-compatibility-validator#55
Pull request Kotlin/binary-compatibility-validator#60

Moved from Kotlin/binary-compatibility-validator@5842109
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

After upgrading to kotlin 1.5.0, the kotlin-parcelize generated code started to be reported as public by binary-compatibility-validator

2 participants