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

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

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

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

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

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

    The program is accepted by the language, but the selected native emit path lacks a proven lowering for this construct.

    Diagnostic and cause

    Ссылка

    Native emitter cannot lower this construct yet

    Семейство
    topaz
    Этап
    emit
    Код
    TPZ6001

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

    A multiple-rest list pattern retains the established TPZ6001 emission-refusal expectation. A single-rest list pattern has supported Rust emission. The language admission policy for multiple rests remains open.

    Действия

    Use one rest element per list pattern. Match additional structure inside that remainder when it is needed.

    Compiler phase: emit.

    Compiler explanation: The program is accepted by the language, but the selected native emit path lacks a proven lowering for this construct.

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

    A multiple-rest list pattern retains the established TPZ6001 emission-refusal expectation. A single-rest list pattern has supported Rust emission. The language admission policy for multiple rests remains open.

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

    Multiple list rests and emission refusal

    A multiple-rest list pattern retains the established TPZ6001 emission-refusal expectation. A single-rest list pattern has supported Rust emission. The language admission policy for multiple rests remains open.

    Response

    Ссылка

    Use one rest element per list pattern. Match additional structure inside that remainder when it is needed.

    Reproduction and verification

    Ссылка

    Rejected program

    Ссылка
    example.tpzRejected programОткрыть песочницу →
    1. let value = match ([1, 2]) {
    2. case [..left, ..right] => 0
    3. case _ => 1
    4. }
    Ожидаемый выводНенулевой код завершения
    $ topaz emit example.tpz --compiler self --target rust · Целевой продукт 5.21.3
    Ожидаемый результат

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

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

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

    The established Rust backend reports the multiple-rest-emission-refusal cause. Current SELF emits several Rust slice rests without establishing that refusal. The P5 runtime/emit product runner preserves TPZ6001 and nonzero; the exact primary location remains pending. These examples do not decide whether the language should admit multiple rests.

    Repaired program

    Ссылка
    example.tpzRepaired programОткрыть песочницу →
    1. let value = match ([1, 2]) {
    2. case [first, ..rest] => 0
    3. case _ => 1
    4. }
    Ожидаемый выводКод завершения 0
    $ topaz emit example.tpz --compiler self --target rust · Целевой продукт 5.21.3
    Ожидаемый результат

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

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

    The established Rust backend reports the multiple-rest-emission-refusal cause. Current SELF emits several Rust slice rests without establishing that refusal. The P5 runtime/emit product runner preserves TPZ6001 and nonzero; the exact primary location remains pending. These examples do not decide whether the language should admit multiple rests.

    Меню

    Загрузка →