meziantou / Meziantou.Polyfill

MIT License
40 stars 1 forks source link

Generated code may use features not supported by the current language version. #38

Closed RachelDavids closed 4 months ago

RachelDavids commented 4 months ago

Version of the Meziantou.Polyfill NuGet package

1.0.38

Description

Several of the generated sources contain "file" level accessibility which is not supported when LangVersion is set to 10.0

Reproduction Steps

Set LangVersion to 10.0 within the project file.

Attempt a build.

Multiple errors error CS8936: Feature 'file types' is not available in C# 10.0. Please use language version 11.0 or greater.

Other information

No response

meziantou commented 4 months ago

Is there something that prevents you from using C# 11?

RachelDavids commented 4 months ago

Personally no - however, In the corporate environment I am currently restricted to version 10.0 (NET6.0)

meziantou commented 4 months ago

.NET 6 is out of support in about 6 months. I'm not sure I want to make changes to support it now, when anyway you'll have to update to .NET 8 very soon.

dodexahedron commented 3 months ago

For V2 I'd agree, but cutting compatibility for bugfixed releases of v1 with existing users is pretty un-good and can alienate users.

Existing applications in corporate environments might still be there several years from now, and us changing minimums kinda breaks the whole "maintenance mode" expectation.

meziantou commented 3 months ago

Existing applications in corporate environments might still be there several years from now, and us changing minimums kinda breaks the whole "maintenance mode" expectation.

It would be a consideration if I were paid by these companies for this project. Providing support for C# 10 should not be complicated, but I don't want to waste my personal time on it.

As a workaround, you can disable the generation of the problematic symbols: https://github.com/meziantou/Meziantou.Polyfill?tab=readme-ov-file#customization

meziantou commented 3 months ago

Of course, you can also submit a PR to provide support for C# 10. I'll be happy to review it!

dodexahedron commented 3 months ago

You can ignore my comment anyway. I thought I was posting in a different project. 😅