beyondnet icon indicating copy to clipboard operation
beyondnet copied to clipboard

Support for C# 14 Extension Members

Open lemonmojo opened this issue 1 month ago • 0 comments

Docs: https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-14#extension-members

This was started in https://github.com/royalapplications/beyondnet/commit/5c8214bc3cdb723dddd8c2ce5a4975792372ca2f. But it's incomplete as the extension members are not yet tied to their extended type so it's currently only possible to call such members through the type that includes the extension (ie. Person_Extensions in the managed sample).

Points of interest:

  • https://github.com/royalapplications/beyondnet/blob/main/Generator/Beyond.NET.CodeGenerator/Collectors/MemberCollector.cs#L166
  • https://github.com/royalapplications/beyondnet/blob/main/Generator/Beyond.NET.CodeGenerator/Collectors/TypeCollector.cs#L398
  • https://github.com/royalapplications/beyondnet/blob/main/Generator/Beyond.NET.CodeGenerator/Syntax/State.cs#L139
  • https://github.com/royalapplications/beyondnet/blob/main/Samples/Beyond.NET.Sample.Managed/Source/Person_Extensions.cs#L23
  • https://github.com/royalapplications/beyondnet/blob/main/Samples/Beyond.NET.Sample.Swift/Tests/TestClasses/PersonTests.swift#L338

lemonmojo avatar Nov 13 '25 11:11 lemonmojo