dart_sealed icon indicating copy to clipboard operation
dart_sealed copied to clipboard

Unnamed constructor

Open FatulM opened this issue 3 years ago • 1 comments

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.

FatulM avatar Sep 12 '21 08:09 FatulM

@iamarnas

FatulM avatar Sep 12 '21 08:09 FatulM