Conversation
…dedTypeDefinition Task 3 (bug fix): Support generative delegate types in the assembly writer. Previously, attempting to create a ProvidedTypeDefinition that extends System.MulticastDelegate would fail because the assembly writer required all methods to either have an invokeCode or be abstract/interface members. Delegate types are special: their .ctor(object, nativeint) and Invoke/ BeginInvoke/EndInvoke methods must carry MethodImplAttributes.Runtime so the CLR synthesises their bodies. No IL body is ever emitted for these methods. Changes in ProvidedTypes.fs: - Add ILMethodBuilder.SetImplementationFlags to allow setting impl attributes - In assembly writer phase 2, detect delegate types and set Runtime|Managed impl flags on all their constructors and methods - In assembly writer phase 3, skip IL body emission for delegate type constructors and methods (the CLR synthesises them from the impl flags) - Fix ProvidedTypeDefinition.GetInterface(name, ignoreCase) to search through GetInterfaces() instead of throwing NotSupportedException - Fix TargetTypeDefinition.GetInterface(name, ignoreCase) similarly Task 5 (coding improvement): Add GenerativeDelegateTests.fs with 5 tests that verify generative delegate type generation produces correct type structure (correct base type, constructor signatures, Invoke signatures). 122 tests pass (117 pre-existing + 5 new). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/repo-assist Fix these CI errors please /home/runner/work/FSharp.TypeProviders.SDK/FSharp.TypeProviders.SDK> /usr/share/dotnet/dotnet build src/FSharp.TypeProviders.SDK.fsproj --configuration Release /nodeReuse:False /clp:ForceConsoleColor (In: false, Out: false, Err: false) Build FAILED. Error: /home/runner/work/FSharp.TypeProviders.SDK/FSharp.TypeProviders.SDK/src/ProvidedTypes.fs(1664,30): error FS0001: This expression was expected to have type� 'string' �but here has type� 'char' [/home/runner/work/FSharp.TypeProviders.SDK/FSharp.TypeProviders.SDK/src/FSharp.TypeProviders.SDK.fsproj::TargetFramework=netstandard2.0] |
Replace char literal '.' with string literal "." in String.Contains calls at lines 1664 and 8161, as the char overload is not available in netstandard2.0. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Commit pushed:
|
🤖 *This PR was created by [Repo Assist](https://github.com/fsprojects/FSharp.TypeProviders.SDK/actions/runs/23774627661), an automated AI assistant.* ## Summary Release notes for version **8.4.0**, covering all changes merged since 8.3.0 (February 26, 2026). ## Changes included in 8.4.0 **Bug fixes:** - `GetEnumUnderlyingType()` now correctly handles non-Int32 enum underlying types (#470) - `decodeILCustomAttribData` reads correct byte-width for non-Int32 enum fixed args (ECMA-335) (#475) - Generative delegate type support fixed; `GetInterface` implemented on `ProvidedTypeDefinition` and `TargetTypeDefinition` (#479) - Thread-safety races in `TargetTypeDefinition` member-wrapper caches fixed (#482) **Performance:** - Member wrapper objects cached in `TargetTypeDefinition` to avoid repeated allocations (#471) - `FullName`, `BaseType` and `GetInterfaces()` cached in `TargetTypeDefinition` (#485) **Refactoring:** - `mkCacheInt32`/`mkCacheGeneric` simplified to use `ConcurrentDictionary` (#486) **CI:** - GitHub Actions updated from v1 to v4 (#476) ## Test Status ✅ All 126 tests pass on the current master (`dotnet test tests/FSharp.TypeProviders.SDK.Tests.fsproj -c Release`) *Please bump the NuGet package version to 8.4.0 in the project file before merging if that step isn't automated.* > Generated by 🌈 Repo Assist at [{run-started}](https://github.com/fsprojects/FSharp.TypeProviders.SDK/actions/runs/23774627661). [Learn more](https://github.com/githubnext/agentics/blob/main/docs/repo-assist.md). > > To install this [agentic workflow](https://github.com/githubnext/agentics/tree/1f672aef974f4246124860fc532f82fe8a93a57e/workflows/repo-assist.md), run > ``` > gh aw add githubnext/agentics@1f672ae > ``` <!-- gh-aw-agentic-workflow: Repo Assist, engine: copilot, model: auto, id: 23774627661, workflow_id: repo-assist, run: https://github.com/fsprojects/FSharp.TypeProviders.SDK/actions/runs/23774627661 --> <!-- gh-aw-workflow-id: repo-assist --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
🤖 This is an automated PR from Repo Assist, an AI assistant for this repository.
Summary
Two related fixes for correctness gaps in the SDK.
Bug fix: Generative delegate types were unsupported (Task 3)
Attempting to create a generative
ProvidedTypeDefinitionthat extendsSystem.MulticastDelegatewould previously fail at assembly-writing time with:The root cause: .NET delegate types are special. Their
.ctor(object, nativeint)andInvoke/BeginInvoke/EndInvokemethods must carryMethodImplAttributes.Runtime | MethodImplAttributes.Managed— the CLR synthesises their bodies at JIT time, and no IL body is ever written in the binary. The old assembly writer had no path for this case.Changes in
ProvidedTypes.fs:ILMethodBuilder.SetImplementationFlagsto expose impl-attribute controlBaseType.FullName = "System.MulticastDelegate") and setRuntime|Managedimpl flags on all their constructors and methodsExample usage that now works: