Skip to content

Commit 4a1963b

Browse files
Phlosioneerericvergnaud
authored andcommittedMar 19, 2024··
Add override specifier to typescript copyfrom codegen
Required for `"noImplicitOverride": true` typescript setting. I couldn't figure out how to add a test for this situation in the typescript test file. It only happens if a rule context class has a subclass. Signed-off-by: Phlosioneer <[email protected]>
1 parent 6ba4f8c commit 4a1963b

File tree

1 file changed

+1
-1
lines changed
  • tool/resources/org/antlr/v4/tool/templates/codegen/TypeScript

1 file changed

+1
-1
lines changed
 

‎tool/resources/org/antlr/v4/tool/templates/codegen/TypeScript/TypeScript.stg

+1-1
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ export class <struct.escapedName> extends <if(contextSuperClass)><contextSuperCl
749749
return <parser.name>.RULE_<struct.derivedFromName>;
750750
}
751751
<if(struct.provideCopyFrom)><! don't need copy unless we have subclasses !>
752-
public copyFrom(ctx: <struct.name>): void {
752+
public override copyFrom(ctx: <struct.name>): void {
753753
super.copyFrom(ctx);
754754
<struct.attrs:{a | this.<a.escapedName> = ctx.<a.escapedName>;}; separator="\n">
755755
}

0 commit comments

Comments
 (0)
Please sign in to comment.