Skip to content

Commit

Permalink
Add an external alias to ignore the duplicate ModuleInitializerAttribute
Browse files Browse the repository at this point in the history
* I don't know why this happens, the ModuleInitializerAttribute is internal
  • Loading branch information
FreeApophis committed Dec 4, 2023
1 parent 3106ede commit 1c1d35d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Funcky.SourceGenerator\Funcky.SourceGenerator.csproj" />
<ProjectReference Include="..\Funcky.SourceGenerator\Funcky.SourceGenerator.csproj">
<Aliases>SourceGeneneratorAlias</Aliases>
</ProjectReference>
</ItemGroup>

</Project>
12 changes: 12 additions & 0 deletions Funcky.SourceGenerator.Test/ModuleInitializer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Runtime.CompilerServices;

namespace Funcky.SourceGenerator.Test;

public static class ModuleInitializer
{
[ModuleInitializer]
public static void Init()
{
VerifySourceGenerators.Enable();
}
}
3 changes: 3 additions & 0 deletions Funcky.SourceGenerator.Test/TestHelper.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
extern alias SourceGeneneratorAlias;

using System.Collections.Immutable;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using OrNoneFromTryPatternGenerator = SourceGeneneratorAlias::Funcky.SourceGenerator.OrNoneFromTryPatternGenerator;

namespace Funcky.SourceGenerator.Test;

Expand Down

0 comments on commit 1c1d35d

Please sign in to comment.