Skip to content

False positive error CS9503 "Required member cannot be less visible than the containing type" for member in nested type #61527

@sirduke

Description

@sirduke

Version Used:
features/required-members

Steps to Reproduce:

internal class InternalOuterCsass
{
    public  class PublicInnerClass
    {
        internal required int field;
    }
}

Expected Behavior:
no error because effective accessibility of containing type is "internal"

Actual Behavior:

error CS9503: Required member 'InternalOuterCsass.PublicInnerClass.field' cannot be less visible or have a setter less visible than the containing type

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