Ah, in that case I take that back. I definitely thought you needed to be able to reference the parent class in order to call (classes defined within other classes, can't remember the nomenclature).
There's no need to do that from within the class. It all works just as it would in an anonymous class today. This code, that employs an anonymous class, is valid Java today (you can paste it into jshell):
new Object() {
record Foo(int x, int y) {}
class Bar { static void print(Foo f) { System.out.println(f); } }
void main() {
Bar.print(makeFoo());
}
Foo makeFoo() { return new Foo(3, 4); }
}.main();
This JEP merely brings together two existing ideas in Java:
1. Anonymous classes
2. Unnamed instances of programming-in-the-large concepts are implicitly provided for you (today this is the case only for packages and modules).
There are no new changes or restrictions to Java syntax in the body of the anonymous class.