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

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

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

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

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

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

    A member access names a field or method that does not exist on the receiver type.

    Diagnostic and cause

    Ссылка

    Unknown member or field

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

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

    A member call must name a member provided by its receiver type. A string call to lenght is rejected with TPZ5006 at the member name; byteLength is an available zero-argument string method.

    Действия

    Check the receiver type and member spelling. Use a declared member or add the required field or method to your type.

    Compiler phase: check/runtime.

    Compiler explanation: A member access names a field or method that does not exist on the receiver type.

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

    • ⟨value⟩ has no field ⟨value⟩ Source

    Observed for the candidate in Topaz 5.21.3. Execution

    • error[TPZ5006]: string has no member named lenght

    A member call must name a member provided by its receiver type. A string call to lenght is rejected with TPZ5006 at the member name; byteLength is an available zero-argument string method.

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

    A member call requires a member on its receiver

    A member call must name a member provided by its receiver type. A string call to lenght is rejected with TPZ5006 at the member name; byteLength is an available zero-argument string method.

    Response

    Ссылка

    Check the receiver type and member spelling. Use a declared member or add the required field or method to your type.

    Reproduction and verification

    Ссылка

    Rejected program

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

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

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

    Repaired program

    Ссылка
    example.tpzRepaired program
    1. let text = "Ada"
    2. text.byteLength()
    Ожидаемый выводКод завершения 0
    $ topaz check example.tpz · Целевой продукт 5.21.3
    Ожидаемый результат

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

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

    Меню

    Загрузка →