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

Invalid error message on passing in parameters by ref #18477

Closed
OmarTawfik opened this issue Apr 5, 2017 · 1 comment
Closed

Invalid error message on passing in parameters by ref #18477

OmarTawfik opened this issue Apr 5, 2017 · 1 comment
Assignees
Milestone

Comments

@OmarTawfik
Copy link
Contributor

OmarTawfik commented Apr 5, 2017

public class C {
    public void M(ref readonly int x) {
    }
    
    public void User() {
        int x = 0;
        M(x);     // OK
        M(ref x); // ERROR
    }
}

Expected: error CS1620: Argument 1 must be passed without the 'ref' keyword
Actual: error CS1620: Argument 1 must be passed with the 'in' keyword

@OmarTawfik
Copy link
Contributor Author

cc @VSadov

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