You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose project ConsoleApp2 depends on project ConsoleApp1
Project ConsoleApp1 depends on PolyType.
Project ConsoleApp1 has [assembly:InternalsVisibleTo("ConsoleApp2")].
This means the following type is duplicate in ConsoleApp2's build:
namespace PolyType.SourceGenerator
{
/// <summary>The source generated <see cref="global::PolyType.ITypeShapeProvider"/> implementation for the current assembly.</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("PolyType.SourceGenerator.PolyTypeGenerator", "0.18.1+5e98a961a4")]
internal sealed partial class ShapeProvider
{
private const global::System.Reflection.BindingFlags __BindingFlags_Instance_All =
global::System.Reflection.BindingFlags.Public |
global::System.Reflection.BindingFlags.NonPublic |
global::System.Reflection.BindingFlags.Instance;
/// <summary>Gets the default instance of the <see cref="ShapeProvider"/> class.</summary>
public static ShapeProvider Default { get; } = new();
/// <summary>Initializes a new instance of the <see cref="ShapeProvider"/> class.</summary>
private ShapeProvider() { }
}
}
Love the look of the project BTW! I have been building my own CSV and Kusto source generator from POCO for a while. This might be a fun project to simplify with.
The text was updated successfully, but these errors were encountered:
What solution would you recommend? It is conceivable that the generator could just suffix the class name with an identifier deriving from the name of the assembly, but I'm wondering if there's a better way.
Disambiguate the name automatically or by configuration (as you stated)
Add a hook to allow assembly aliasing. Seems like a pain and may not even work for project reference (never tried).
Not sure of feasibility -- but could ConsoleApp2 re-use ConsoleApp1's implementation?
I am not sure if existing users of the library expect the shape provider to be called ShapeProvider. If so, option 1 would need to be opt-in (or enabled only when InternalsVisibleTo is detected).
Suppose project ConsoleApp2 depends on project ConsoleApp1
Project ConsoleApp1 depends on PolyType.
Project ConsoleApp1 has
[assembly:InternalsVisibleTo("ConsoleApp2")]
.This means the following type is duplicate in ConsoleApp2's build:
Love the look of the project BTW! I have been building my own CSV and Kusto source generator from POCO for a while. This might be a fun project to simplify with.
The text was updated successfully, but these errors were encountered: