Skip to content

Inaccessible Members on an Interface With a DIM Are Processed #364

@JasonBock

Description

@JasonBock

To Reproduce

var source =
	"""
	using System;

	internal abstract class BuilderNode 
	{ 
		protected BuilderNode() { }
	}

	public interface ITransactGetItemRequestBuilder
	{
		internal BuilderNode GetNode() => throw new NotImplementedException();
		internal Type GetEntityType() => throw new NotImplementedException();
	}
	""";

var code =
	"""
	using Rocks;
	
	[assembly: Rock(typeof(ITransactGetItemRequestBuilder), BuildType.Create | BuildType.Make)]
	""";

Expected behavior
The type should be considered non-mockable.

Actual behavior
Rocks implements both members, which causes numerous CS0122 errors

Additional context
If the members did not have a DIM, no code is generated as Rocks correctly identifies that neither member can be implemented in an implementing type from another assembly. However, when a DIM exists, Rocks, for some reason, tries to process it.

This was found in EfficientDynamoDb.Operations.TransactGetItems.ITransactGetItemRequestBuilder

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions