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

Introduce TyErr independent from TyInfer #40887

Merged
merged 2 commits into from
Apr 8, 2017

Commits on Apr 2, 2017

  1. Introduce TyErr independent from TyInfer

    Add a `TyErr` type to represent unknown types in places where
    parse errors have happened, while still able to build the AST.
    
    Initially only used to represent incorrectly written fn arguments and
    avoid "expected X parameters, found Y" errors when called with the
    appropriate amount of parameters. We cannot use `TyInfer` for this as
    `_` is not allowed as a valid argument type.
    
    Example output:
    
    ```rust
    error: expected one of `:` or `@`, found `,`
      --> file.rs:12:9
       |
    12 | fn bar(x, y: usize) {}
       |         ^
    
    error[E0061]: this function takes 2 parameters but 3 parameters were supplied
      --> file.rs:19:9
       |
    12 | fn bar(x, y) {}
       | --------------- defined here
    ...
    19 |     bar(1, 2, 3);
       |         ^^^^^^^ expected 2 parameters
    ```
    estebank committed Apr 2, 2017
    Configuration menu
    Copy the full SHA
    b83352e View commit details
    Browse the repository at this point in the history

Commits on Apr 7, 2017

  1. Configuration menu
    Copy the full SHA
    8c31412 View commit details
    Browse the repository at this point in the history