Interface ProblemPrinter<Specifics>

interface ProblemPrinter<Specifics extends TypirSpecifics> {
    printAssignabilityProblem(problem: AssignabilityProblem): string;
    printIndexedTypeConflict(problem: IndexedTypeConflict): string;
    printInferenceProblem(problem: InferenceProblem<Specifics>): string;
    printLanguageNode(
        languageNode: Specifics["LanguageType"],
        sentenceBegin: boolean,
    ): string;
    printSubTypeProblem(problem: SubTypeProblem): string;
    printTypeEqualityProblem(problem: TypeEqualityProblem): string;
    printTypeName(type: Type): string;
    printTypeUserRepresentation(type: Type): string;
    printTypirProblem(problem: TypirProblem): string;
    printTypirProblems(problems: TypirProblem[]): string;
    printValidationProblem(problem: ValidationProblem<Specifics>): string;
    printValueConflict(problem: ValueConflict): string;
}

Type Parameters

Implemented by

Methods

  • Parameters

    • languageNode: Specifics["LanguageType"]
    • sentenceBegin: boolean

    Returns string

  • This function should be used by other services, instead of using type.getName(). This enables to customize the printing of type names by overriding only this implementation.

    Parameters

    • type: Type

      the type to print

    Returns string

    the name of the given type

  • This function should be used by other services, instead of using type.getUserRepresentation(). This enables to customize the printing of type names by overriding only this implementation.

    Parameters

    • type: Type

      the type to print

    Returns string

    the user representation of the given type