Q:\source\typeshape-csharp\tests\TypeShape.Tests\obj\Debug\net8.0\generated\TypeShape.SourceGenerator\TypeShape.SourceGenerator.TypeShapeIncrementalGenerator\TypeShape.Tests.MsgPackSerializerTests.Witness.MyEnum.g.cs(25,38,25,43): error CS0119: 'int' is a type, which is not valid in the given context
which points to this generated code:
private global::TypeShape.Abstractions.ITypeShape<global::TypeShape.Tests.MyEnum> Create_MyEnum()
{
return new global::TypeShape.SourceGenModel.SourceGenEnumTypeShape<global::TypeShape.Tests.MyEnum, int>
{
UnderlyingType = Int32, // error on this line
Provider = this,
};
}
I can workaround it by adding yet another witness explicitly:
+[GenerateShape<int>]
[GenerateShape<MyEnum>]
partial class Witness { }
But having to do that seems very tedious. Shouldn't transitive types like this be implicit?
When I add this to the
TypeShape.Tests
project:I get this compile error:
which points to this generated code:
I can workaround it by adding yet another witness explicitly:
But having to do that seems very tedious. Shouldn't transitive types like this be implicit?