dadhi / DryIoc

DryIoc is fast, small, full-featured IoC Container for .NET
MIT License
1.03k stars 122 forks source link

Source code DryIoc package cannot be used in netstandard 2.0 projects #491

Closed abramovandrey closed 2 years ago

abramovandrey commented 2 years ago

If you add 5.0.0 package or higher to your netstandard 2.0 project you will get following compilation errors as netstandard 2.0 does not "support" pattern matchinge:

\dryioc\5.0.0\contentFiles\cs\netstandard2.0\DryIoc\Expression.cs(146,13,166,14): error CS8370: Feature 'recursive patterns' is not available in C# 7.3. Please use language version 8.0 or greater. \dryioc\5.0.0\contentFiles\cs\netstandard2.0\DryIoc\Expression.cs(627,20,645,14): error CS8370: Feature 'recursive patterns' is not available in C# 7.3. Please use language version 8.0 or greater. \dryioc\5.0.0\contentFiles\cs\netstandard2.0\DryIoc\Expression.cs(2585,13,2592,14): error CS8370: Feature 'recursive patterns' is not available in C# 7.3. Please use language version 8.0 or greater. \dryioc\5.0.0\contentFiles\cs\netstandard2.0\DryIoc\FastExpressionCompiler.cs(5441,13,5452,14): error CS8370: Feature 'recursive patterns' is not available in C# 7.3. Please use language version 8.0 or greater. \dryioc\5.0.0\contentFiles\cs\netstandard2.0\DryIoc\FastExpressionCompiler.cs(7133,13,7171,14): error CS8370: Feature 'recursive patterns' is not available in C# 7.3. Please use language version 8.0 or greater.

dadhi commented 2 years ago

netstandard 2.0 does not "support" pattern matching:

It is not the .NET Standard, but rather your language version is C# 7.3. I am using the last language version for the code and consequently for the source packages (C# 10.0 at the moment). The solution is to update version on your side, or to not use the source version, or fork and change the code to the lower version.