Skip to content

Unexpected overloading error #488

@pschachte

Description

@pschachte

This code

?lst = [2]

if { [?hd | ?tl] = lst :: !println "nonempty"
   | else              :: !println "empty"
}

fails to compile with this error:

Error detected during type checking of module(s) tst
tst.wybe:1:10: Ambiguous overloading: call could refer to:
    wybe.string.[]<1> (partial)
    wybe.string.[]<0> (partial)
    wybe.range.[]<0> (partial)
    wybe.list.[]<1>
    wybe.list.[]<0> (partial)
    wybe.c_string.[]<0> (partial)
    wybe.array.[]<1> (partial)
    wybe.array.[]<0> (partial)

Oddly, leaving out the if statement, or even just removing the !println calls, fixes it, so there's something in the println statements that causes a bogus overloading error in the first line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingerror 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