Parcelable: Add CREATOR field (and other generated declarations) in light classes (KT-19300, KT-19853)
This commit is contained in:
+5
-2
@@ -327,8 +327,11 @@ object IDELightClassContexts {
|
||||
private val annotationsThatAffectCodegen = listOf(
|
||||
"JvmField", "JvmOverloads", "JvmName", "JvmStatic",
|
||||
"Synchronized", "Transient", "Volatile", "Strictfp"
|
||||
).map { FqName("kotlin.jvm").child(Name.identifier(it)) } + FqName("kotlin.PublishedApi") + FqName("kotlin.Deprecated") + FqName("kotlin.internal.InlineOnly")
|
||||
|
||||
).map { FqName("kotlin.jvm").child(Name.identifier(it)) } +
|
||||
FqName("kotlin.PublishedApi") +
|
||||
FqName("kotlin.Deprecated") +
|
||||
FqName("kotlin.internal.InlineOnly") +
|
||||
FqName("kotlinx.android.parcel.Parcelize")
|
||||
}
|
||||
|
||||
class AdHocAnnotationResolver(
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ sealed class LazyLightClassDataHolder(
|
||||
if (dummyDelegate == null) return KtLightFieldImpl.fromClsFields(clsDelegate, containingClass)
|
||||
|
||||
return dummyDelegate!!.fields.map { dummyField ->
|
||||
val fieldOrigin = KtLightFieldImpl.getOrigin(dummyField)!!
|
||||
val fieldOrigin = KtLightFieldImpl.getOrigin(dummyField)
|
||||
|
||||
val fieldName = dummyField.name!!
|
||||
KtLightFieldImpl.lazy(dummyField, fieldOrigin, containingClass) {
|
||||
|
||||
@@ -33,10 +33,12 @@ abstract class AbstractKotlinLintTest : KotlinAndroidTestCase() {
|
||||
AndroidLintInspectionBase.invalidateInspectionShortName2IssueMap()
|
||||
(myFixture as CodeInsightTestFixtureImpl).setVirtualFileFilter { false } // Allow access to tree elements.
|
||||
ConfigLibraryUtil.configureKotlinRuntime(myModule)
|
||||
ConfigLibraryUtil.addLibrary(myModule, "androidExtensionsRuntime", "dist/kotlinc/lib", arrayOf("android-extensions-runtime.jar"))
|
||||
}
|
||||
|
||||
override fun tearDown() {
|
||||
ConfigLibraryUtil.unConfigureKotlinRuntime(myModule)
|
||||
ConfigLibraryUtil.removeLibrary(myModule, "androidExtensionsRuntime")
|
||||
super.tearDown()
|
||||
}
|
||||
|
||||
|
||||
Vendored
+4
@@ -3,6 +3,7 @@
|
||||
@file:Suppress("UsePropertyAccessSyntax", "UNUSED_VARIABLE", "unused", "UNUSED_PARAMETER", "DEPRECATION")
|
||||
import android.os.Parcel
|
||||
import android.os.Parcelable
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
|
||||
class <error descr="This class implements `Parcelable` but does not provide a `CREATOR` field">MyParcelable1</error> : Parcelable {
|
||||
override fun describeContents() = 0
|
||||
@@ -98,3 +99,6 @@ internal abstract class MyParcelable4 : Parcelable {
|
||||
override fun describeContents() = 0
|
||||
override fun writeToParcel(arg0: Parcel, arg1: Int) {}
|
||||
}
|
||||
|
||||
@Parcelize
|
||||
class ParcelizeUser(val firstName: String, val lastName: String) : Parcelable
|
||||
Reference in New Issue
Block a user