Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use serializers defined on properties of a base class by default for extending types #162

Open
Whathecode opened this issue Jun 27, 2018 · 1 comment

Comments

@Whathecode
Copy link
Contributor

When a custom serializer is defined on an overridable property of a base class, I expected this serializer to be used for extending classes which override this property as well.

Instead, when a property is overridden, the custom serializer specified using @Serializable( with = ... ) is not used.

@Serializable
abstract class Base
{
    @Serializable( with = CustomSerializer )
    abstract val willOverride: String
}

class Extends( override val willOverride: String ) : Base()

The only way I see to make this work is to specify @Serializable( with = CustomSerializer ) on willOverride of all extending classes.

@pdvrieze
Copy link
Contributor

In general annotations on inherited values are ignored. This bug is broader than @Serializable, it needs additional logic in the compiler plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants