Closed maxandersen closed 1 month ago
btw. this works:
package mypackage;
import io.soabase.recordbuilder.core.RecordBuilder;
@RecordBuilder
record Person(String name, int age) {};
class demo {
void main() {
var fb = PersonBuilder.builder().name("John").age(20).build();
System.out.println("Hello, World: " + fb);
}
}
but would love to remove all the unnecessary parts :)
might actually be a limitation of naked mains.
Funny enough I can put the records in a separate file and it works.
in Java 23 preview you can have naked main that cannot be in a package; when I try use record-builder it seem to use classname as package:
demo.java:
result in a generated class named:
demoPersonBuilder.java
and inside it generates:which does not work/compile.