Skip to content

Default-value annotation #646

@malcolmredheron

Description

@malcolmredheron

As I understand it, the intended procedure when adding a field to a case class that I have serialized with upickle is to give it a default value, so that I can continue to read old data

However, if I do this then I lose type safety, since all of my existing code, which doesn't pass the value, still compiles. So I have to define a matching object for the case class, with an apply() method that has all the same arguments and passes them through. It's a bit of a drag

Would you consider an annotation that provides the default value? Or is there some other way to do what I'm trying to do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions