Skip to content

Visibility Issues With protected internal Property #216

@JasonBock

Description

@JasonBock

To reproduce:

public abstract class VisibilityIssues
{
  protected internal virtual bool OwnsHandle { get; protected set; }
}

var expectations = Rock.Create<VisibilityIssues>();

This causes errors like:

Error - Id: CS0273, Description: Rocks\Rocks.RockCreateGenerator\SKRegion_Rock_Create.g.cs(268,15): error CS0273: The accessibility modifier of the 'CreateExpectationsOfSKRegionExtensions.RockSKRegion.OwnsHandle.set' accessor must be more restrictive than the property or indexer 'CreateExpectationsOfSKRegionExtensions.RockSKRegion.OwnsHandle'

Basically, the property is generated as protected, not protected internal, so when the setter is generated as protected set, it causes an issue.

This was found on SkiaSharp.SKRegion.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions