Proposal: Creator applications (going new-less)

This issue wouldn’t exist if some inconsistencies with classes and constructors were fixed.

  1. For some reason, constructors always have at least one parameter list. If none is provided one is added implicitly, both at the definition and use site. If they behaved more like methods the compiler would say something like “missing argument list for constructor Foo”. You would have to write new Foo() { ... } instead.
  2. Parameters to regular methods can be provided with {} instead of (). With a constructor suddenly you’re defining an anonymous subclass instead.
2 Likes