Class UniqueMethodValidation<T>

Predefined validation to produce errors, if inside a class the same method is declared more than once.

Type Parameters

  • T

Implements

Constructors

Properties

foundDeclarations: Map<string, UniqueMethodValidationEntry[]> = ...
getClassOfMethod: (languageNode: T, methodType: FunctionType) => unknown

Determines the corresponding language node of the class declaration, so that Typir can infer its ClassType

isMethodDeclaration: (languageNode: unknown) => languageNode is T

Determines language nodes which represent declared methods, improves performance a lot.

services: TypirServices
uniqueClassValidator: undefined | UniqueClassValidation

Methods

  • Calculates a key for a method which encodes its unique properties, i.e. duplicate methods have the same key. Additionally, the class of the method needs to be represented in the key as well. This key is used to identify duplicated methods. Override this method to change the properties which make a method unique.

    Parameters

    Returns string

    a string key