Skip to content

Instantly share code, notes, and snippets.

@ShikaSD
Created March 31, 2020 15:38
Show Gist options
  • Save ShikaSD/92dedf4b031ed38194171be919034dba to your computer and use it in GitHub Desktop.
Save ShikaSD/92dedf4b031ed38194171be919034dba to your computer and use it in GitHub Desktop.
fun ClassDescriptor.isSerializable(): Boolean =
getSuperInterfaces().any {
it.fqNameSafe == SERIALIZABLE_FQ_NAME || it.isSerializable()
} || getSuperClassNotAny()?.isSerializable() == true
val SERIALIZABLE_FQ_NAME = FqName("java.io.Serializable")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment