Class UniqueMethodValidation<Specifics, T>

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

Type Parameters

Implements

Constructors

Properties

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

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

isMethodDeclaration: (
    languageNode: Specifics["LanguageType"],
) => languageNode is T

Determines language nodes which represent declared methods, improves performance.

uniqueClassValidator: undefined | UniqueClassValidation<Specifics>

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