Skip to content

Overloading on in/byval should cause an error #22132

@VSadov

Description

@VSadov

The following seems to not result in an error, but should:

namespace ConsoleApp33
{
    class Program
    {
        static void Main(string[] args)
        {
            var o = new P1();
        }

        public void Foo(in int z) { }

        public void Foo(int z) { }
    }

    class P1: Program
    {

    }
}

We should also add tests to make sure we select the correct overload, also in case of in situation of ambiguity (because of inheritance or extension methods)

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