dart_sealed
dart_sealed copied to clipboard
Unnamed constructor
Add ability to define unnamed constructor.
An easy way is to provide an annotation like @UnNamed()
or to reserve a method name like noNamed
for this purpose.
Another way is to use constructors on manifest class to denote no named constructor.
Complexities arise when implementing match methods. But we do not need cast methods for in named constructor as it means that we do not need unnamed sub class entirely.
Special thanks to @iamarnas for his recommendations.
@iamarnas