Skip to content

Poor error message when ! on call is omitted #462

@pschachte

Description

@pschachte

This code

resource to_parse:string

def {partial} digit(?d:int) use !to_parse {
    to_parse = [?ch | ?to_parse]
    ch >= '0' & ch <= '9'
    ?d = ord(ch) - ord('0')
}

def {partial} integer(?i:int) use !to_parse {
    digit(?i)
    do {
        while (!digit(?d))
        ?i = i * 10 + d
    }
}

Gives this misleading error message:

examples.wybe:97:5: Type error in partial application of proc digit, argument 1
examples.wybe:97:5: Type error in call to proc digit, argument 1

The actual problem is that the ! is omitted at the front of the first call to digit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    error messagedetection and reporting of errors in Wybe code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions