Skip to content

Omitting primitive equality breaks interface generation #682

@SteveDunn

Description

@SteveDunn

Describe the bug

You can omit primitive equality generation with:

[assembly: VogenDefaults(primitiveEqualityGeneration: PrimitiveEqualityGeneration.Omit)];

But this conflicts with other generated code, in particular the generation of the IVogen<> interface. To demonstrate, this cominbation causes compilation errors as IVogen expects implementers to have equality to the primitive:

[assembly: VogenDefaults(
  primitiveEqualityGeneration: PrimitiveEqualityGeneration.Omit,
  staticAbstractsGeneration: StaticAbstractsGeneration.MostCommon | StaticAbstractsGeneration.InstanceMethodsAndProperties)]

... causes...
Error CS0535 : 'ToDoItemId' does not implement interface member 'IVogen<ToDoItemId, int>.operator ==(ToDoItemId, int)'


### Steps to reproduce

Omit equality to primitive generation, and specify IVogen interface generation.

### Expected behaviour

For `IVogen<>` to not declare primitive equality methods and operators.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions