typescript-generator icon indicating copy to clipboard operation
typescript-generator copied to clipboard

missing override keyword when creating fromData method on inherited class

Open alebo611 opened this issue 1 year ago • 1 comments

If a class A inherits class B, the resulting typescript classes will both have each a fromData method. However, A, must have the keyword is missing the "override" keyword in order to be syntactically correct typescript.

wrong: static fromData(data: FooBar, target?: FooBar): FooBar {

correct: static override fromData(data: FooBar, target?: FooBar): FooBar {

alebo611 avatar Nov 21 '23 15:11 alebo611

I have the same problem. I get exported

export class EditChapterDto extends ChapterDto<EditChapterDto> {
  children: EditChapterDto[];

but I need to have

export class EditChapterDto extends ChapterDto<EditChapterDto> {
   override  children: EditChapterDto[];

leomayer avatar Nov 28 '23 09:11 leomayer