pardeike / Harmony

A library for patching, replacing and decorating .NET and Mono methods during runtime
https://www.patreon.com/pardeike
MIT License
5.15k stars 485 forks source link

Using GeneratedRegex causes failed compile due to ReadOnlySpan #570

Closed DubyaDude closed 7 months ago

DubyaDude commented 7 months ago

Describe the bug When attempting to utilize dotnets GeneratedRegex with the Harmony lib being imported, the generated regex class causes a compile time error as of Harmony 2.3.0 prerelease 6.

To Reproduce Code:

public partial class PlayGround
{
    [GeneratedRegex(@"\w+")]
    private static partial Regex GetGeneratedRegex();
}

Error on compile: Code CS0433 The type 'ReadOnlySpan<T>' exists in both '0Harmony, Version=2.3.0.0, Culture=neutral, PublicKeyToken=null' and 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

Expected behavior No compile time error.

Screenshots / Code devenv_sCFRdbI5Jj image

Runtime environment (please complete the following information):

Additional context Was not an issue prior, started as of updating from Harmony 2.3.0-prerelease.5 -> 2.3.0-prerelease.7

DubyaDude commented 7 months ago

Sorry, was not aware of the change of the main NuGet package becoming a Fat version, switching to Thin resolved it.

If you still feel like this is an issue you'd like to resolve for the Fat version, you can re-open

Aragas commented 7 months ago

The issue should be resolved for the Fat version once the next version is out