top | item 34483645

(no title)

GlitchMr | 3 years ago

This particular restriction is mostly arbitrary anyway because `this` and `super` accept arbitrary expressions (including static method calls), so in most cases it's possible to do this, just with much worse syntax.

Technically, this does introduce new functionality when extending a class, specifically it's possible to choose a constructor to overload depending on arguments, but in most cases there is usually one constructor that all other constructors use.

discuss

order

taeric|3 years ago

Isn't it already possible to choose which constructor to overload?

sleepychu|3 years ago

With this change you can add logic to pick the overloaded constructor based on the value of the arguments (as opposed to the sequence of types)