Skip to content

Invalid error message on passing in parameters by ref #18477

@OmarTawfik

Description

@OmarTawfik
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

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions