Skip to content

Need to use 'override' keyword #48

@johndeighan

Description

@johndeighan

I created my own copy of hera to play with. One of the issues I ran into was that this generated an error in machine.ts:

export class ParseError extends Error {
  name = "ParseError"
  constructor(
    public header: string,
    public body: string | undefined,
    public filename: string,
    public line: number,
    public column: number,
    public offset: number,
  ) {
    let message = `${filename}:${line}:${column} ${header}`
    if (body) message += `\n${body}`
    super(message)
    this.message = message
  }
}

The issue is that name = "ParseError" needs to be override name = "ParseError". I think this only happens in newer versions of TypeScript.
Or maybe there's a configuration to prevent this error, I don't know. I also don't know whether making this change would break hera when using older versions of TypeScript. Just making sure you're aware of the potential problem. I'm using deno, so I'm just going to use their default TypeScript setup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions