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

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

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

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

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

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

    The left side of an assignment is not an assignable place.

    Diagnostic and cause

    Ссылка

    Invalid assignment target

    Семейство
    topaz
    Этап
    parse
    Код
    TPZ2003

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

    An assignment target must be an identifier, member access, or index access.

    Действия

    Assign to a mutable binding or to a supported member or index rooted in one. Mutability and type compatibility are checked after this syntax requirement.

    Compiler phase: parse.

    Compiler explanation: The left side of an assignment is not an assignable place.

    Message templates. The marker ⟨value⟩ stands for text computed for the reported program.

    • assignment target must be an identifier, member access, or index access Source

    Observed for the candidate in Topaz 5.21.3. Execution

    • error[TPZ2003]: assignment target must be an identifier, member access, or index access

    The left side of an assignment is a computed expression. The parser accepts an identifier, member access, or index access in that position.

    Правилоdiagnostics.tpz2003.rule

    Trigger and repair

    An assignment target must be an identifier, member access, or index access.

    Response

    Ссылка

    Assign to a mutable binding or to a supported member or index rooted in one. Mutability and type compatibility are checked after this syntax requirement.

    Reproduction and verification

    Ссылка

    Rejected program

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

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

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

    The expected diagnostic, cause, source location, and accompanying diagnostics are specified below. The verification status records whether this program has been run.

    Corrected program

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

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

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

    This program applies the repair described above. The verification status records whether it has been run.

    Меню

    Загрузка →