Skip to content

Badly misleading type error messages #487

@pschachte

Description

@pschachte

This code

resource res:int = 0

def foo(?val:int) use res { ?val = res }

foo(?x)
!println x

gives the compiler errors:

Error detected during type checking of module(s) tst
tst.wybe:6:2: Type error in call to proc println, argument 1
tst.wybe:6:2: Call from module top-level code to proc println with 1 argument(s), expected 2

which actually leads one away from the actual error (missing ! on call to foo).

I believe the cause is that foo(?x) is taken to bind x to a closure for !foo.

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