Skip to content

Typescript build failure in ThrowingErrorListener because of incompatibility with ANTLRErrorListener #64

@lizaiv77

Description

@lizaiv77

Version 4.4.0

When running tsc --build I get following error

node_modules/@apexdevtools/apex-parser/lib/ThrowingErrorListener.d.ts:9:5 - error TS2416: Property 'syntaxError' in type 'ThrowingErrorListener' is not assignable to the same property in base type 'ANTLRErrorListener<Token>'.
  Type '(recognizer: Recognizer<Token, any>, offendingSymbol: Token, line: number, charPositionInLine: number, msg: string, e: RecognitionException | undefined) => any' is not assignable to type '<T extends Token>(recognizer: Recognizer<T, any>, offendingSymbol: T | undefined, line: number, charPositionInLine: number, msg: string, e: RecognitionException | undefined) => void'.
    Types of parameters 'offendingSymbol' and 'offendingSymbol' are incompatible.
      Type 'T | undefined' is not assignable to type 'Token'.
        Type 'undefined' is not assignable to type 'Token'.

9     syntaxError(recognizer: Recognizer<Token, any>, offendingSymbol: Token, line: number, charPositionInLine: number, msg: string, e: RecognitionException | undefined): any;

In ThrowingErrorListener offendingSymbol: should be Token | undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions