From a46f75cf476d5694bb4c4502586df95acb4cee21 Mon Sep 17 00:00:00 2001 From: Dennis Kuduzovic Date: Tue, 19 Jul 2022 21:33:09 -0600 Subject: [PATCH 1/2] tdd --- test/typescript.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/typescript.ts b/test/typescript.ts index 65dc82c4..24d62a74 100644 --- a/test/typescript.ts +++ b/test/typescript.ts @@ -257,6 +257,14 @@ const nodeMajorVersion = parseInt(process.versions.node, 10); "}", ]); + check([ + "class Dog extends Animal {", + " protected override getSound() {", + " return 'bark';", + " }", + "}", + ]) + check(["export interface S {", " i(s: string): boolean", "}"]); check([ From bc030e55305795698fd7d80a6df4d9cb38fd14f8 Mon Sep 17 00:00:00 2001 From: Dennis Kuduzovic Date: Tue, 19 Jul 2022 21:34:32 -0600 Subject: [PATCH 2/2] add override keyword to printMethod function --- lib/printer.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/printer.ts b/lib/printer.ts index 3452f75b..cb526b61 100644 --- a/lib/printer.ts +++ b/lib/printer.ts @@ -2741,6 +2741,10 @@ function printMethod(path: any, options: any, print: any) { parts.push("abstract "); } + if (node.override) { + parts.push("override "); + } + if (node.readonly) { parts.push("readonly "); }