Skip to content
Topaz6.0 · Before release
Download

Search documentation

Specification 6.0 · Not released · Tested product 5.21.3

Use arrow keys to choose a result. Press Enter to open.

Type an API name, diagnostic number, rule, or project topic.

    Diagnostics

    TPZ5006: Unknown member or field

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

    Diagnostic and cause

    Link

    Unknown member or field

    Family
    topaz
    Phase
    check
    Code
    TPZ5006

    Cause and conditions

    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.

    Source evidence

    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.

    Rulediagnostics.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.

    Source evidence

    Response

    Link

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

    Reproduction and verification

    Link

    Rejected program

    Link
    example.tpzRejected programOpen in Playground
    1. let text = "Ada"
    2. text.lenght()
    Expected outputNonzero exit
    No stdout.
    $ topaz check example.tpz · target product 5.21.3
    Expected result

    Expected result

    Rejection during check. Nonzero exit.

    • TPZ5006 diagnostic-tpz5006 at example.tpz:2:6
    Source evidence

    Repaired program

    Link
    example.tpzRepaired program
    1. let text = "Ada"
    2. text.byteLength()
    Expected outputexit 0
    $ topaz check example.tpz · target product 5.21.3
    Expected result

    Expected result

    Checking accepts the program. Exit code 0.

    Source evidence

    Menu

    Download