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

Bad error message when not enough type arguments in method call #1396

Closed
Theodus opened this issue Nov 5, 2016 · 1 comment · Fixed by #1397
Closed

Bad error message when not enough type arguments in method call #1396

Theodus opened this issue Nov 5, 2016 · 1 comment · Fixed by #1397
Assignees

Comments

@Theodus
Copy link
Contributor

Theodus commented Nov 5, 2016

Code:

use "collections"

actor Main
  new create(env: Env) =>
    let xs = List[USize]
    xs.map(lambda(n: USize): I64 => n.i64() end)

Output:

Error:
/usr/local/ponyc/packages/collections/list.pony:247:10: not enough type arguments
  fun map[B](f: {(this->A!): B^} box): List[B]^ =>
         ^
    Info:
    /usr/local/ponyc/packages/collections/list.pony:247:10: definition is here
      fun map[B](f: {(this->A!): B^} box): List[B]^ =>
             ^

The error message shows the method definition rather than the location of the error.

@Theodus Theodus self-assigned this Nov 5, 2016
@Theodus
Copy link
Contributor Author

Theodus commented Nov 5, 2016

Update: The problem is in https://github.com/ponylang/ponyc/blob/master/src/libponyc/type/reify.c#L116
where the error is reported:

ast_error(opt->check.errors, typeargs, "too many type arguments");

The failure occurs in the case that typeargs is empty.

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

Successfully merging a pull request may close this issue.

1 participant