Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error messages for wrong number of arguments #814

Open
knikamo opened this issue Jun 1, 2017 · 0 comments
Open

Error messages for wrong number of arguments #814

knikamo opened this issue Jun 1, 2017 · 0 comments

Comments

@knikamo
Copy link
Contributor

knikamo commented Jun 1, 2017

#810
The error message for wrong number of arguments is not adjusted to the new feature default parameters.

When compiling this code:

active class Main
  def main() : unit
    this.foo()
  end

  def foo(a: int, b: int = 0) : unit
    println(a)
    println(b)
  end
end

...the following error message is given:

*** Error during typechecking *** 
Method 'foo' in class 'Main' expects 2 arguments. Got 0
In expression: 
  this.foo()
...

The problem is that the error message is misleading. Since foo has one default parameter it expects 1-2 arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants