spotify / dataenum

Algebraic data types in Java.
Apache License 2.0
166 stars 16 forks source link

Duplicate field names in @DataEnum specification interfaces #11

Closed togi closed 6 years ago

togi commented 6 years ago

Currently the following is allowed by the annotation processor:

@DataEnum
interface Text_dataenum {
    dataenum_case Foo(int bar):
    dataenum_case Foo(long bar);
}

However this will cause two inner classes to be generated with the same name, so the resulting class does not compile.

The annotation processor should detect duplicate case names and abort compilation with an error explaining the problem.