Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jun 23, 2025

This PR removes the conditional compilation directives for ActivityDisposable that were needed during the nullness bootstrapping phase when the "last known good" compiler had bugs around 'use' and nullable disposable handling.

Changes Made

  1. Removed conditional compilation block from NullnessShims.fs:

    // REMOVED:
    #if BUILDING_WITH_LKG
        type ActivityDisposable = System.IDisposable
    #else
        type ActivityDisposable = System.IDisposable | null
    #endif
  2. Updated function signatures in Activity.fs and Activity.fsi to directly use System.IDisposable | null:

    • start: name: string -> tags: (string * string) seq -> System.IDisposable | null
    • startNoTags: name: string -> System.IDisposable | null
    • startAndMeasureEnvironmentStats: name: string -> System.IDisposable | null

Impact

  • Simplifies the codebase by removing conditional compilation complexity
  • All ActivityDisposable references are now directly replaced with System.IDisposable | null
  • No functional changes to behavior - the type alias was already resolving to System.IDisposable | null in the non-LKG case
  • Maintains nullness safety while removing the bootstrapping workaround

The changes are minimal and surgical, affecting only the necessary files to complete the cleanup of the nullness bootstrapping infrastructure.

Fixes #18706.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 1k9vsblobprodcus379.vsblob.vsassets.io
    • Triggering command: dotnet restore FSharp.Compiler.Service.sln (dns block)
  • 4vyvsblobprodcus361.vsblob.vsassets.io
    • Triggering command: dotnet restore FSharp.Compiler.Service.sln (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] Conditional directives and ActivitityDisposable are no longer needed Remove ActivityDisposable conditional directives and replace with System.IDisposable | null Jun 23, 2025
Copilot AI requested a review from T-Gro June 23, 2025 15:12
Copilot finished work on behalf of T-Gro June 23, 2025 15:12
@T-Gro T-Gro marked this pull request as ready for review June 23, 2025 15:16
@T-Gro T-Gro requested a review from a team as a code owner June 23, 2025 15:16
@T-Gro T-Gro requested a review from abonie June 23, 2025 15:17
@github-actions
Copy link
Contributor

github-actions bot commented Jun 24, 2025

⚠️ Release notes required, but author opted out

Warning

Author opted out of release notes, check is disabled for this pull request.
cc @dotnet/fsharp-team-msft

@T-Gro T-Gro enabled auto-merge (squash) June 24, 2025 08:36
@T-Gro T-Gro added the NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes label Jun 24, 2025
@T-Gro T-Gro merged commit dd55484 into main Jun 24, 2025
39 of 40 checks passed
@github-project-automation github-project-automation bot moved this from New to In Progress in F# Compiler and Tooling Jun 24, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in F# Compiler and Tooling Jun 24, 2025
T-Gro added a commit that referenced this pull request Jun 24, 2025
* More test for error recovery  (#18669)

* [main] Update dependencies from dnceng/internal/dotnet-optimization (#18683)

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20250610.1

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime
 From Version 1.0.0-prerelease.25309.1 -> To Version 1.0.0-prerelease.25310.1

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20250611.1

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime
 From Version 1.0.0-prerelease.25309.1 -> To Version 1.0.0-prerelease.25311.1

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20250616.1

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime
 From Version 1.0.0-prerelease.25309.1 -> To Version 1.0.0-prerelease.25316.1

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20250617.1

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime
 From Version 1.0.0-prerelease.25309.1 -> To Version 1.0.0-prerelease.25317.1

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Tomas Grosup <[email protected]>

* [main] Update dependencies from dotnet/arcade (#18643)

* Expand docstring on SynModuleDecl.Types (#18698)

* Update dependencies from https://github.com/dotnet/arcade build 20250620.5 (#18703)

Microsoft.DotNet.Arcade.Sdk
 From Version 10.0.0-beta.25316.2 -> To Version 10.0.0-beta.25320.5

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* Remove feature/lsp merge from branch-merge.yml (#18705)

Cleaning up, sicne we've merged feature/lsp to main some time ago

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20250623.1 (#18710)

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime
 From Version 1.0.0-prerelease.25317.1 -> To Version 1.0.0-prerelease.25323.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* Update dependencies from https://github.com/dotnet/arcade build 20250623.3 (#18709)

Microsoft.DotNet.Arcade.Sdk
 From Version 10.0.0-beta.25320.5 -> To Version 10.0.0-beta.25323.3

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* Remove ActivityDisposable conditional directives and replace with System.IDisposable | null (#18707)

---------

Co-authored-by: Edgar Gonzalez <[email protected]>
Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Tomas Grosup <[email protected]>
Co-authored-by: Patrick Stevens <[email protected]>
Co-authored-by: Adam Boniecki <[email protected]>
Co-authored-by: Copilot <[email protected]>
brianrourkeboll pushed a commit to brianrourkeboll/fsharp that referenced this pull request Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Conditional directives and ActivitityDisposable are no longer needed

3 participants