eclipse-vertx / vertx-codegen

Vert.x code generator for asynchronous polyglot APIs
Apache License 2.0
105 stars 92 forks source link

Should throw error on VertxGen declared inside VertxGen/DataObject #319

Open pmlopes opened 3 years ago

pmlopes commented 3 years ago

Currently, I've noticed a few generation errors regarding how classes and interfaces are annotated.

For example, if a @VertxGen interface has a enum declared inside, this will be valid java code and will compile and no warning is given by codegen. However, you will not be able to process such element.

@VertxGen
interface A {
  @VertxGen
  enum E { }
}

In the example above E will never be processed and no warning or error is raised. I think we should raise an error in this situation.

The same applies for @DataObject. During the processing we should guarantee that this isn't allowed. This pattern is a problem to es4x but may not be for other generators, so we may agree in raising a warning instead.

pmlopes commented 3 years ago

@cescoffier @codepitbull you also work with codegen can you check if this also affects you?