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

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

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

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

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

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

    The source used an operator spelling reserved away from the current language.

    Diagnostic and cause

    Ссылка

    Reserved operator

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

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

    The unary operator ~ is reserved and rejected during parsing.

    Действия

    Choose the operation required by the program. Use - for arithmetic negation or ! for Boolean negation. Neither is an integer bitwise-negation replacement.

    Compiler phase: parse.

    Compiler explanation: The source used an operator spelling reserved away from the current language.

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

    • reserved operator ~: Topaz has no bitwise operations Source

    Observed for the candidate in Topaz 5.21.3. Execution

    • error[TPZ2013]: reserved operator ~: Topaz has no bitwise operations

    The expression uses ~, which is reserved. Topaz does not provide an integer bitwise-negation operation through this spelling.

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

    Trigger and repair

    The unary operator ~ is reserved and rejected during parsing.

    Response

    Ссылка

    Choose the operation required by the program. Use - for arithmetic negation or ! for Boolean negation. Neither is an integer bitwise-negation replacement.

    Reproduction and verification

    Ссылка

    Rejected program

    Ссылка
    example.tpzRejected programОткрыть песочницу →
    1. let flags = 1
    2. let result = ~flags
    Ожидаемый выводНенулевой код завершения
    Нет стандартного вывода.
    $ 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 flags = 1
    2. let result = -flags
    Ожидаемый выводКод завершения 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.

    Меню

    Загрузка →