Перейти к содержимому
Топаз6.0 · До релиза
Загрузка →

Поиск в документации

Спецификация 6.0

Выберите результат стрелками и нажмите Enter, чтобы открыть его.

Введите имя API, номер диагностики, правило или тему проекта.

    Диагностика TPZ5023

    A type alias expands back to itself through one or more aliases.

    Diagnostic and cause

    Ссылка

    Type alias cycle

    Семейство
    topaz
    Этап
    check
    Код
    TPZ5023

    Причина и условия

    Transparent type aliases must normalize without a cycle.

    Действия

    Remove the cycle or introduce a nominal record, enum, or newtype boundary that expresses the intended data structure.

    Compiler phase: check.

    Compiler explanation: A type alias expands back to itself through one or more aliases.

    Message templates are Pending. The explanation above is not an observed CLI message.

    Transparent type aliases must normalize without a cycle.

    Правилоdiagnostics.tpz5023.p5.rule

    Type alias cycle

    Transparent type aliases must normalize without a cycle.

    Response

    Ссылка

    Remove the cycle or introduce a nominal record, enum, or newtype boundary that expresses the intended data structure.

    Reproduction and verification

    Ссылка

    Rejected program

    Ссылка
    example.tpzRejected programОткрыть песочницу →
    1. type First = Second
    2. type Second = First
    3. let value: First = 1
    Ожидаемый выводНенулевой код завершения
    Нет стандартного вывода.
    $ topaz check example.tpz · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения check. Ненулевой код завершения.

    Контракт обязательного основного местоположения не определён.

    The intended rejection is recorded as an implementation limitation. A current SELF producer does not establish the diagnostic source location, so that location remains Pending.

    Repaired program

    Ссылка
    example.tpzRepaired program
    1. type First = int
    2. type Second = First
    3. let value: First = 1
    Ожидаемый выводКод завершения 0
    $ topaz check example.tpz · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Проверка принимает программу. Код завершения 0.

    The intended rejection is recorded as an implementation limitation. A current SELF producer does not establish the diagnostic source location, so that location remains Pending.

    Меню

    Загрузка →