Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dfd0e1d

Browse files
dotnet-maestro[bot]auduchinokT-GroCopilotgithub-actions[bot]
authored
[feature/net11-scouting] Update dependencies from dotnet/arcade (#19910)
* Tests: extract 'should update baselines' checks (#19734) * Fix #19596: unit-parameter member conformance with signature (#19615) * Fix #19596: overloaded member with unit parameter conformance check SignatureConformance.fs: when matching overloaded members, add relaxed fallback for unmatched pairs using type equivalence. This handles member M(()) (argInfos=[[]]) vs sig member M: unit->unit (argInfos=[[unit_arg]]) where types are equivalent but TotalArgCount differs. * Harden AI review quality: subagent dispatch, inline-only, no wall-of-text (#19772) Evidence from 17 AI review audit: - 53% had zero inline comments (wall-of-text body only) - 5 reviews were LGTM verdicts buried in avg 1500 chars of prose - Only 3/17 were inline-focused (ideal) expert-reviewer.md: - Wave 0: MUST dispatch independent subagents per dimension via task tool - Wave 5: empty body for findings (just inline comments), 'LGTM' for approve - New hard rule: body >10 chars (other than LGTM) is a bug - Removed 'See inline comments' boilerplate — people have eyes reviewing-compiler-prs/SKILL.md: - Replaced aspirational 'Multi-Model Dispatch' with concrete 'Subagent Dispatch' - Each dimension gets independent background agent with CHECK rules + filtered diffs - Subagents produce structured {file, line, severity, dimension, issue, suggestion} - Expert-reviewer consolidates, deduplicates, applies assessment gates Co-authored-by: Copilot <[email protected]> * Gate exception field serialization behind langversion 11 (#19746) * Gate exception serialization codegen behind LanguageFeature.ExceptionFieldSerializationSupport (F# 11) The GetObjectData override and field-restoring deserialization constructor for exception types are now gated behind langversion 11. With langversion <=10 (the current default), exceptions emit only the base-call ctor (status quo ante PR #19342). - Add LanguageFeature.ExceptionFieldSerializationSupport, mapped to F# 11.0 - Gate shouldRestoreFields and GetObjectData emission on the feature - Update tests to use withLangVersion "11" - Update all IL baselines (SerializableAttribute, Nullness) to reflect the default-langversion output (no field serde IL) Co-authored-by: Copilot <[email protected]> * Fix code formatting (fantomas) Co-authored-by: Copilot <[email protected]> * Update xlf files for featureExceptionFieldSerializationSupport Co-authored-by: Copilot <[email protected]> * Fix net472 IL baseline for ExceptionType nullness test The net472 baseline was incorrectly updated to use [runtime] prefixed NullableContextAttribute and NullableAttribute references. On net472, these attributes are embedded in the assembly (not from runtime BCL), so they must not have the [runtime] prefix. Also restore the embedded attribute class definitions at the end of the file. The serialization changes (removing field-restoring ctor and GetObjectData) are correctly kept, as they match the default langversion behavior. Co-authored-by: Copilot <[email protected]> * Add release notes for exception field serialization langversion gate Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Clean up state-machine workflow: remove stale refs, fix numbering (#19784) - Exclude shared/ from workflow discovery (for repos with shared imports) - Remove tooling-check-repo-rules.md reference (belongs to the security scan workflow, not the diagram generator) - Fix rule numbering gap (was 1,2,3,4,5 → now 1,2,3,4) - Replace fsharp-specific 'repo-assist' example with generic placeholder Co-authored-by: Copilot <[email protected]> * Honor --nowarn for command-line option warnings (#19776) * Add failing tests for #19576 (TDD red) Tests demonstrate that --nowarn:N does not suppress warnings emitted during command-line option parsing (e.g. FS0075 for internal/test-only options like --extraoptimizationloops, --typedtree). Co-authored-by: Copilot <[email protected]> * Honor --nowarn for warnings captured during command-line option parsing (#19576) Wrap the logger used to replay delayed command-line diagnostics with GetDiagnosticsLoggerFilteringByScopedNowarn so that --nowarn / --warnaserror / warn-level switches set on the command line are honored for diagnostics captured during option parsing (e.g. FS0075 from internal/test-only flags such as --extraoptimizationloops or --typedtree). The fix is applied both on the success path (fsc.fs main1, line ~586) and on the error/exit paths via the IDiagnosticsLoggerProvider extension method, making it universal across fsc.exe and FSharpChecker.Compile. Co-authored-by: Copilot <[email protected]> * Remove speculative third test for --test unknown-arg The third test added in TDD red phase was speculative (warning numbers didn't match) and outside the scope of sprint 2's DoD. Sprint 2 only required the first two tests (FS0075 for --extraoptimizationloops and --typedtree) to pass. Co-authored-by: Copilot <[email protected]> * Centralize warning emission in CompilerOptions.fs (#19576 follow-up) Introduce a local 'warningCmdLine' helper that consults tcConfigB.diagnosticsOptions via PhasedDiagnostic.AdjustSeverity before forwarding to warning/errorR/informationalWarning. This gives option parsing a second, local line of defense so future 'warning' callsites in CompilerOptions.fs cannot silently bypass --nowarn/--warnaserror even if the commit-time delayed-diagnostics wrapper is missing. - Thread TcConfigBuilder through ParseCompilerOptions (all 6 callers). - Thread TcConfigBuilder through CheckAndReportSourceFileDuplicates. - Route the three cowboy 'warning' callsites in CompilerOptions.fs (reportDeprecatedOption, --test unknown-arg, duplicate source file) through warningCmdLine. - Add a regression test for FS1063 (--test unknown sub-flag). Co-authored-by: Copilot <[email protected]> * Consolidate command-line nowarn tests into Theory and add FS3551 case Co-authored-by: Copilot <[email protected]> * Remove warningCmdLine; use commit-time filtering only; add missing tests The emit-time warningCmdLine helper was order-dependent (only worked when --nowarn preceded the triggering option) and introduced a regression with --warnaserror+ (premature abort via errorR incrementing ErrorCount before --nowarn could take effect). Replace with commit-time filtering via GetDiagnosticsLoggerFilteringByScopedNowarn at the two sites in fsc.fs where CapturingDiagnosticsLogger replays captured diagnostics. This correctly applies all --nowarn/--warnaserror settings accumulated during the full option parsing pass. Revert ParseCompilerOptions and CheckAndReportSourceFileDuplicates signatures to their original forms (no TcConfigBuilder parameter needed). Add missing tests: - Baseline tests verifying warnings ARE emitted without --nowarn - --warnaserror+ with --nowarn interaction test Co-authored-by: Copilot <[email protected]> * Close test gaps: reverse-order, warnaserror baselines, specific warnaserror semantics Add tests identified by multi-model adversarial review: - Reverse-order test (--option before --nowarn) proves commit-time filtering works regardless of argument ordering - --warnaserror+ baseline proving warning is promoted to error - --warnaserror+ with --nowarn proving nowarn takes precedence (global) - --warnaserror:75 with --nowarn:75 documenting that specific warnaserror wins over --nowarn (AdjustSeverity uses localNowarn for specific, warnOff for global) 13 tests total, 0 duplication of test source code. Co-authored-by: Copilot <[email protected]> * Add mixed-code selectivity test for --nowarn precision Triggers both FS0075 and FS1063 simultaneously, suppresses only FS0075 via --nowarn:75, and asserts FS1063 still fires. Catches regressions where filtering accidentally drops all command-line warnings. Co-authored-by: Copilot <[email protected]> * Fix case-sensitivity: track test file under fsc/ (lowercase) for Linux CI The file was tracked by git as CompilerOptions/Fsc/warn/ (uppercase) while the fsproj and all sibling files use lowercase fsc/. On case-sensitive Linux this caused FS0225 'source file not found'. Co-authored-by: Copilot <[email protected]> * Address review: remove slop comments, add order-independence test - Remove type annotation restating what inference provides - Replace code-restating comments with WHY-comments - Add test: --nowarn before --warnaserror+ still suppresses Co-authored-by: Copilot <[email protected]> * Address review: trim duplicate tests, remove slop comments Remove mechanical test duplicates (15→7): drop Theory×3 testing same warn number with different triggers, drop duplicate withNoWarn vs raw --nowarn:N tests, drop redundant order-independence test. Move release notes to 11.0.100.md (VNEXT). Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]> * Add CCR-OptOut review instruction (#19787) Co-authored-by: Copilot <[email protected]> * Switch CCR opt-out to check PR body for 'SKIP CCR REVIEW' (#19789) * Bump system versions (#19790) Update .NET SDK from 10.0.202 to 10.0.204. Co-authored-by: Copilot <[email protected]> * Fix nullness narrowing in match inside comprehensions (#19743) * Fix nullness narrowing for match inside seq/list/array comprehensions (#19644) Extract null-narrowing helper EliminateNullnessFromInputType from TcMatchClause and reuse it in TcSequenceExpression's SynExpr.Match handler so the input type is narrowed across clauses inside comprehensions, matching the behavior of plain match expressions. Co-authored-by: Copilot <[email protected]> * Add release notes for #19644 Co-authored-by: Copilot <[email protected]> * Fix test failures on net472: remove System.Collections.Immutable dependency The ImmutableHashSet<int>.Builder type is not available in the net472 test compilation environment. Replace with string | null which tests the same nullness narrowing logic without requiring external assembly references. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]> * Narrow overload-error and symbol-use ranges to terminal identifier (#19505) * Narrow overload-error and symbol-use ranges to terminal identifier (#14284, #3920) * [main] Update dependencies from dotnet/arcade (#19794) * Update dependencies from https://github.com/dotnet/arcade build 20260519.10 On relative base path root Microsoft.DotNet.Arcade.Sdk From Version 10.0.0-beta.26269.2 -> To Version 10.0.0-beta.26269.10 * Update dependencies from https://github.com/dotnet/arcade build 20260525.1 On relative base path root Microsoft.DotNet.Arcade.Sdk From Version 10.0.0-beta.26269.2 -> To Version 10.0.0-beta.26275.1 --------- Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> * Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20260522.1 (#19793) On relative base path root 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.26180.1 -> To Version 1.0.0-prerelease.26272.1 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> * [main] Update dependencies from dotnet/roslyn (#19780) * Update dependencies from https://github.com/dotnet/roslyn build 20260520.10 On relative base path root Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.Compilers , Microsoft.CodeAnalysis.CSharp , Microsoft.CodeAnalysis.EditorFeatures , Microsoft.CodeAnalysis.EditorFeatures.Text , Microsoft.CodeAnalysis.ExternalAccess.FSharp , Microsoft.CodeAnalysis.Features , Microsoft.VisualStudio.LanguageServices From Version 5.8.0-1.26268.6 -> To Version 5.8.0-1.26270.10 * Update dependencies from https://github.com/dotnet/roslyn build 20260521.1 On relative base path root Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.Compilers , Microsoft.CodeAnalysis.CSharp , Microsoft.CodeAnalysis.EditorFeatures , Microsoft.CodeAnalysis.EditorFeatures.Text , Microsoft.CodeAnalysis.ExternalAccess.FSharp , Microsoft.CodeAnalysis.Features , Microsoft.VisualStudio.LanguageServices From Version 5.8.0-1.26268.6 -> To Version 5.8.0-1.26271.1 * Update dependencies from https://github.com/dotnet/roslyn build 20260522.14 On relative base path root Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.Compilers , Microsoft.CodeAnalysis.CSharp , Microsoft.CodeAnalysis.EditorFeatures , Microsoft.CodeAnalysis.EditorFeatures.Text , Microsoft.CodeAnalysis.ExternalAccess.FSharp , Microsoft.CodeAnalysis.Features , Microsoft.VisualStudio.LanguageServices From Version 5.8.0-1.26268.6 -> To Version 5.8.0-1.26272.14 * Update dependencies from https://github.com/dotnet/roslyn build 20260523.3 On relative base path root Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.Compilers , Microsoft.CodeAnalysis.CSharp , Microsoft.CodeAnalysis.EditorFeatures , Microsoft.CodeAnalysis.EditorFeatures.Text , Microsoft.CodeAnalysis.ExternalAccess.FSharp , Microsoft.CodeAnalysis.Features , Microsoft.VisualStudio.LanguageServices From Version 5.8.0-1.26268.6 -> To Version 5.8.0-1.26273.3 * Update dependencies from https://github.com/dotnet/roslyn build 20260524.3 On relative base path root Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.Compilers , Microsoft.CodeAnalysis.CSharp , Microsoft.CodeAnalysis.EditorFeatures , Microsoft.CodeAnalysis.EditorFeatures.Text , Microsoft.CodeAnalysis.ExternalAccess.FSharp , Microsoft.CodeAnalysis.Features , Microsoft.VisualStudio.LanguageServices From Version 5.8.0-1.26268.6 -> To Version 5.8.0-1.26274.3 * Update dependencies from https://github.com/dotnet/roslyn build 20260524.20 On relative base path root Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.Compilers , Microsoft.CodeAnalysis.CSharp , Microsoft.CodeAnalysis.EditorFeatures , Microsoft.CodeAnalysis.EditorFeatures.Text , Microsoft.CodeAnalysis.ExternalAccess.FSharp , Microsoft.CodeAnalysis.Features , Microsoft.VisualStudio.LanguageServices From Version 5.8.0-1.26268.6 -> To Version 5.8.0-1.26274.20 --------- 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/msbuild (#19779) * Update dependencies from https://github.com/dotnet/msbuild build 20260520.4 On relative base path root Microsoft.Build , Microsoft.Build.Framework , Microsoft.Build.Tasks.Core , Microsoft.Build.Utilities.Core From Version 18.8.0-preview-26269-11 -> To Version 18.8.0-preview-26270-04 * Update dependencies from https://github.com/dotnet/msbuild build 20260521.6 On relative base path root Microsoft.Build , Microsoft.Build.Framework , Microsoft.Build.Tasks.Core , Microsoft.Build.Utilities.Core From Version 18.8.0-preview-26269-11 -> To Version 18.8.0-preview-26271-06 * Update dependencies from https://github.com/dotnet/msbuild build 20260522.6 On relative base path root Microsoft.Build , Microsoft.Build.Framework , Microsoft.Build.Tasks.Core , Microsoft.Build.Utilities.Core From Version 18.8.0-preview-26269-11 -> To Version 18.8.0-preview-26272-06 * Update dependencies from https://github.com/dotnet/msbuild build 20260525.9 On relative base path root Microsoft.Build , Microsoft.Build.Framework , Microsoft.Build.Tasks.Core , Microsoft.Build.Utilities.Core From Version 18.8.0-preview-26269-11 -> To Version 18.8.0-preview-26275-09 --------- Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Tomas Grosup <[email protected]> * Override System.Security.Cryptography.Xml to 10.0.8 (#19830) * Override System.Security.Cryptography.Xml to 10.0.8 Transitive dependency from Microsoft.Build.Tasks.Core pins System.Security.Cryptography.Xml at 10.0.4. Add direct reference in FSharp.Build to override to 10.0.8. Co-authored-by: Copilot <[email protected]> * Fix MSB3277: mark Cryptography.Xml as PrivateAssets to prevent net472 conflicts The System.Security.Cryptography.Xml 10.0.8 override pulls transitive dependencies (Microsoft.Bcl.Cryptography, System.Formats.Asn1) that conflict with System.ValueTuple on net472 when flowing through ProjectReference from FSharp.Build to fsc.fsproj. PrivateAssets="all" prevents the package from flowing to consuming projects while keeping it available to FSharp.Build at build-task runtime. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Change protected-files policy to 'allowed' for labelops-pr-maintenance workflow (#19783) The workflow resolves merge conflicts by merging from main, which naturally includes changes to protected files. The previous 'fallback-to-issue' policy blocked these normal merge operations. The prompt still has "Never modify .github/**" as a hard rule to prevent the agent from inventing changes. * Fix Repo Assist: recompile lock files to v0.76.1, harden data fetch step (#19727) * Initial plan * Fix Repo Assist workflow: recompile lock files to v0.72.1, reduce API limits to prevent timeouts Root causes: 1. AWF binary v0.25.28 was removed from GitHub releases (404 error) 2. gh issue list --limit 500 through DIFC proxy causes 504 timeouts Fixes: - Recompile all workflow lock files from v0.68.3/v0.71.1 to v0.72.1 (AWF containers updated from 0.25.20/0.25.28 to 0.25.41) - Reduce issue fetch limit from 500 to 200 - Reduce PR fetch limit from 200 to 100 - Add fallback to empty JSON on fetch failures Agent-Logs-Url: https://github.com/dotnet/fsharp/sessions/5524a246-1400-4899-9b62-aaf71ac6996f Co-authored-by: T-Gro <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: T-Gro <[email protected]> Co-authored-by: Tomas Grosup <[email protected]> Co-authored-by: Tomas Grosup <[email protected]> * Fix overload resolution of static member extension (#19698) * Fix #19664: Extension static methods are resolved if similar intrisic methods exist * [Auto Update] Agentic workflows — fix safe-outputs config and apply pending upgrade (#19756) * Initial plan * Update agentic workflows via gh aw upgrade and fix safe-outputs config - Updated actions/github-script from v8 to v9 - Updated github/gh-aw-actions/setup from v0.68.3 to v0.72.1 - Updated github/gh-aw/actions/setup from v0.67.2 to v0.72.1 - Updated actions-lock.json with pinned container images - Recompiled all workflow lock files - Updated agent file to v0.72.1 references - Fixed aw-auto-update.md safe-outputs config: - Added github-app config for workflows permission - Added allow-workflows: true for create-pull-request and push-to-pull-request-branch - Changed protected-files from fallback-to-issue to allowed Co-authored-by: T-Gro <[email protected]> * Recompile all workflows after merge conflict resolution (gh-aw v0.74.8) Co-authored-by: T-Gro <[email protected]> * Recompile all workflows after merge conflict resolution Co-authored-by: T-Gro <[email protected]> * Recompile workflows after merge conflict resolution Co-authored-by: T-Gro <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: T-Gro <[email protected]> Co-authored-by: Tomas Grosup <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Tomas Grosup <[email protected]> * Parser: recover on unfinished if and binary expressions (#19724) * Fix ValueOption optional args via ?param caller syntax (#19711) (#19742) When the SupportValueOptionsAsOptionalParameters language feature is enabled, do not force option<_> on caller-side ?name = expr arguments during overload inference. Leave the type as a fresh inference variable and let AdjustCalledArgTypeForOptionals (CalleeSide) reconcile against option<_> or voption<_>. Pre-LangVersion-10 behaviour is preserved. Co-authored-by: Copilot <[email protected]> * Disable noop issue reporting for labelops-pr-maintenance workflow (#19842) * Initial plan * Disable noop issue reporting for labelops-pr-maintenance workflow Co-authored-by: T-Gro <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: T-Gro <[email protected]> Co-authored-by: Tomas Grosup <[email protected]> * Fix delegate Invoke semantic classification (in the IDE)(#19813) * Fix #19657: MeasureAnnotatedAbbreviation over ref type + | null (#19775) * Add failing TDD tests for #19657: MeasureAnnotatedAbbreviation over reference type with | null Add four tests in NullableReferenceTypesTests.fs covering: - MeasureAnnotatedAbbreviation over string accepts | null in let bindings, parameters, returns, type abbreviations, and inline instantiations (fails today). - MeasureAnnotatedAbbreviation over user-defined reference class accepts | null (fails today). - MeasureAnnotatedAbbreviation over value types still rejects | null (non-regression, passes today). - Nullness flow and not-null constraints work through the abbreviation (fails today; compilation does not reach the flow assertions). Co-authored-by: Copilot <[email protected]> * Fix #19657: strip measure equations in SolveTypeIsReferenceType MeasureAnnotatedAbbreviation tycons over a reference type (e.g. UMX-style `type string<[<Measure>] 'm> = string`) previously failed the reference-type constraint check used by the `| null` syntax, producing FS0043. The surface type is a TType_app over a MeasureableReprTycon, which isRefTy does not recognise. Strip measure equations before testing reference semantics so the underlying erased representation is consulted, consistent with TypeNullNever and IsReferenceTyparTy. Value-type erasure still correctly fails FS0043. Also corrects a Sprint 1 test expectation that listed a phantom diagnostic which the compiler does not emit (the matched-on null case is fully covered). Co-authored-by: Copilot <[email protected]> * Release notes for #19657 MeasureAnnotatedAbbreviation + | null fix Co-authored-by: Copilot <[email protected]> * Address review findings: rename strippedTy, add edge-case tests - Rename strippedTy -> underlyingTy for consistency with SolveTypeIsNonNullableValueType - Condense comment to single line - Add test: not-struct constraint satisfied by MeasureAnnotatedAbbreviation - Add test: MAA over obj, interface, and chained abbreviation Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]> * Make aw-auto-update detection-only and delegate workflow PRs to Copilot Coding Agent (#19840) * Initial plan * Fix aw-auto-update: add allow-workflows and github-app for workflow file push The workflow was failing with "refusing to allow a GitHub App to create or update workflow without workflows permission" because pushing .github/workflows/ files requires the workflows:write permission. Fix by adding: - allow-workflows: true to create-pull-request and push-to-pull-request-branch - github-app config (client-id/private-key) required for workflows permission - Fixed deprecated labels/title-prefix in push-to-pull-request-branch Co-authored-by: T-Gro <[email protected]> * Replace push-to-workflow flow with create-agent-session delegation The previous attempt added a GitHub App with new required secrets to bypass GitHub's rule that GITHUB_TOKEN cannot push under .github/workflows/. The repo has no GH App and no plan to provision one. Make aw-auto-update detection-only: its safe outputs are restricted to noop (the normal steady state) and create-agent-session. When an upgrade is detected, the workflow delegates the actual upgrade + recompile + PR work to a Copilot Coding Agent session authenticated via COPILOT_GITHUB_TOKEN, which already exists in the repo and can write workflow files under its own identity. No new secrets, no GitHub App, no allow-workflows. Co-authored-by: Copilot <[email protected]> * Remove explicit github-token from create-agent-session Creating the agent task is an API-only call from the safe-outputs runner; the runner does not touch workflow files (that happens later in the spawned CCA session, under CCA's own identity). Default GITHUB_TOKEN with issues:write should handle it. If gh agent-task create needs more later, we'll add it then. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: T-Gro <[email protected]> Co-authored-by: Tomas Grosup <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Copilot <[email protected]> * Fix state-machine workflow: add protected-files: allowed for .github/docs/ output (#19852) The agentic-state-machine workflow has been failing since PR #19721 moved the output to .github/docs/state-machine.md. Files under .github/ are treated as protected by gh-aw (agent instruction files, security config). The allowed-files config permits WHICH files can be modified but does not override the built-in protected-files blocking. Adding protected-files: allowed explicitly opts in, which is safe since allowed-files already restricts writes to .github/docs/** only. Fixes #19739 Co-authored-by: Copilot <[email protected]> * Fix source-build: track Cryptography.Xml via Version.Details (#19839) * Fix source-build: track System.Security.Cryptography.Xml via Version.Details Move System.Security.Cryptography.Xml version management from hardcoded eng/Versions.props to eng/Version.Details.xml + Version.Details.props, following the same pattern as System.Diagnostics.DiagnosticSource and other System.* runtime dependencies. This allows source-build to use the live-built package instead of a prebuilt NuGet download. Co-authored-by: Copilot <[email protected]> * Restore PrivateAssets=all on System.Security.Cryptography.Xml Removing PrivateAssets=all caused transitive dependencies (Microsoft.Bcl.Cryptography, System.Formats.Asn1, etc.) to flow into fsc.fsproj on net472, triggering MSB3277 version conflicts with System.ValueTuple from .NET Framework reference assemblies. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Copilot <[email protected]> * docs: update state-machine with security scan workflow and infra changes (#19856) - Add labelops-pr-security-scan (hourly PR safety classifier) - Update aw-auto-update to reflect create-agent-session delegation - Add all security scan labels to label dictionary - Update source hashes Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <[email protected]> * Fix #18841: let _ = &expr now compiles like let x = &expr (#19811) * Fix docs path exclusion to use recursive wildcard in azure-pipelines-PR.yml (#19848) * Initial plan * Fix docs path exclusion to use recursive wildcard docs/** Co-authored-by: T-Gro <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: T-Gro <[email protected]> * Add concurrency group to PR Tooling Safety Check workflow (#19841) * Initial plan * Add concurrency group to PR Tooling Safety Check to prevent concurrent repo-memory pushes Co-authored-by: T-Gro <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: T-Gro <[email protected]> Co-authored-by: Tomas Grosup <[email protected]> * Symbols: add ObsoleteDiagnosticInfo (#19359) * Symbols: add ObsoleteDiagnosticInfo * Extracts fast checks for Obsolete attribute * Fixes RequiredMembers check * Adds Checker.getMethodOverloads test helper * Release notes * Rename * Fix VisualFSharp build * Fix non-deterministic reference assembly MVIDs (#19751) (#19801) Replace randomized String.GetHashCode with deterministic FNV-1a 32-bit hash in TypeHashing.hashText and hashILTypeRef. The per-process hash seed in .NET 6+ caused --refout / ProduceReferenceAssembly to emit a different MVID on every build. Co-authored-by: Copilot <[email protected]> * Fix colorization of type name in MyType<Qualified.Name>.StaticMember (#19800) * Fix colorization of type name in MyType<Qualified.Name>.S (#18009) Accept ItemOccurrence.InvalidUse in LegitTypeOccurrence so that the type-name span in expressions like MyType<System.Int32>.S - which name resolution flags as InvalidUse via isWrongItemInExpr - is still classified as a ReferenceType, matching the behavior for the unqualified form MyType<int>.S. * Reject non-function bindings for single-case and partial active pattern names (#19763) * Add InlineIfLambda to Array.init (#19869) * Update state-machine.md for security scan draft filter and repo rules (#19872) - Add draft PR filter to security scan diagram - Add repo rules to security scan reads column - Update source hash for labelops-pr-security-scan.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <[email protected]> * Fix SRTP `get_Item` witness resolution for `string` indexers (#19757) * Glossary improvement (#19881) Co-authored-by: Copilot <[email protected]> * Remove duplicate and unused file (#19886) SkipLocalsInit.fs file exisits in two different folders and only one of the copies is actually included in the project. * [main] Update dependencies from dotnet/roslyn (#19827) * Update dependencies from https://github.com/dotnet/roslyn build 20260526.4 On relative base path root Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.Compilers , Microsoft.CodeAnalysis.CSharp , Microsoft.CodeAnalysis.EditorFeatures , Microsoft.CodeAnalysis.EditorFeatures.Text , Microsoft.CodeAnalysis.ExternalAccess.FSharp , Microsoft.CodeAnalysis.Features , Microsoft.VisualStudio.LanguageServices From Version 5.8.0-1.26274.20 -> To Version 5.8.0-1.26276.4 * Update dependencies from https://github.com/dotnet/roslyn build 20260527.7 On relative base path root Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.Compilers , Microsoft.CodeAnalysis.CSharp , Microsoft.CodeAnalysis.EditorFeatures , Microsoft.CodeAnalysis.EditorFeatures.Text , Microsoft.CodeAnalysis.ExternalAccess.FSharp , Microsoft.CodeAnalysis.Features , Microsoft.VisualStudio.LanguageServices From Version 5.8.0-1.26274.20 -> To Version 5.9.0-1.26277.7 * Update dependencies from https://github.com/dotnet/roslyn build 20260528.5 On relative base path root Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.Compilers , Microsoft.CodeAnalysis.CSharp , Microsoft.CodeAnalysis.EditorFeatures , Microsoft.CodeAnalysis.EditorFeatures.Text , Microsoft.CodeAnalysis.ExternalAccess.FSharp , Microsoft.CodeAnalysis.Features , Microsoft.VisualStudio.LanguageServices From Version 5.8.0-1.26274.20 -> To Version 5.9.0-1.26278.5 * Update dependencies from https://github.com/dotnet/roslyn build 20260529.9 On relative base path root Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.Compilers , Microsoft.CodeAnalysis.CSharp , Microsoft.CodeAnalysis.EditorFeatures , Microsoft.CodeAnalysis.EditorFeatures.Text , Microsoft.CodeAnalysis.ExternalAccess.FSharp , Microsoft.CodeAnalysis.Features , Microsoft.VisualStudio.LanguageServices From Version 5.8.0-1.26274.20 -> To Version 5.9.0-1.26279.9 * Update dependencies from https://github.com/dotnet/roslyn build 20260601.8 On relative base path root Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.Compilers , Microsoft.CodeAnalysis.CSharp , Microsoft.CodeAnalysis.EditorFeatures , Microsoft.CodeAnalysis.EditorFeatures.Text , Microsoft.CodeAnalysis.ExternalAccess.FSharp , Microsoft.CodeAnalysis.Features , Microsoft.VisualStudio.LanguageServices From Version 5.8.0-1.26274.20 -> To Version 5.9.0-1.26301.8 * Update dependencies from https://github.com/dotnet/roslyn build 20260602.3 On relative base path root Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.Compilers , Microsoft.CodeAnalysis.CSharp , Microsoft.CodeAnalysis.EditorFeatures , Microsoft.CodeAnalysis.EditorFeatures.Text , Microsoft.CodeAnalysis.ExternalAccess.FSharp , Microsoft.CodeAnalysis.Features , Microsoft.VisualStudio.LanguageServices From Version 5.8.0-1.26274.20 -> To Version 5.9.0-1.26302.3 --------- Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> * Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20260526.2 (#19824) On relative base path root 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.26272.1 -> To Version 1.0.0-prerelease.26276.2 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> * [main] Update dependencies from dotnet/arcade (#19825) * Update dependencies from https://github.com/dotnet/arcade build 20260526.7 On relative base path root Microsoft.DotNet.Arcade.Sdk From Version 10.0.0-beta.26275.1 -> To Version 10.0.0-beta.26276.7 * Update dependencies from https://github.com/dotnet/arcade build 20260528.2 On relative base path root Microsoft.DotNet.Arcade.Sdk From Version 10.0.0-beta.26275.1 -> To Version 10.0.0-beta.26278.2 * Update dependencies from https://github.com/dotnet/arcade build 20260601.2 On relative base path root Microsoft.DotNet.Arcade.Sdk From Version 10.0.0-beta.26275.1 -> To Version 10.0.0-beta.26301.2 --------- Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> * Dedup format specifier locations in computation expressions (#19791) * Preserve type aliases in match | null refinement (#19745) * Add failing TDD tests for issue #19646 (alias dropped after | null pattern) After 'match x with | null -> ... | s -> ...', the type of s loses its alias (e.g. 'string' becomes 'System.String'). These tests lock in the desired behavior; they fail on main and will pass once the fix lands. Refs https://github.com/dotnet/fsharp/issues/19646 Co-authored-by: Copilot <[email protected]> * Fix #19646: preserve type aliases in match | null refinement The removeNull helper in TcMatchClause was unconditionally calling stripTyEqns, which expanded transparent abbreviations like 'string' to 'System.String'. As a result, in: let test (x: string | null) = match x with | null -> null | s -> s.Replace("a", "b") the inferred type of 's' was displayed as 'String' instead of 'string'. Fix: try the cheap path first (replaceNullnessOfTy KnownWithoutNull), which preserves the abbreviation. If the resulting effective nullness is already WithoutNull (transparent aliases like 'string' / 'MyStr'), use that. Otherwise (abbreviations that encode nullness in their RHS, like 'type objnull = obj | null'), fall back to the full stripTyEqns path introduced by #18852 to keep that regression fixed. Co-authored-by: Copilot <[email protected]> * Collapse Issue 19646 tests into a Theory Per review feedback: parameterize the three alias preservation cases (string, user alias, Uri alias) into a single Theory with InlineData, and drop the redundant negative test (the case-sensitive substring match on 'string' already rules out 'String'). Refs #19646 Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]> * Suppress hover/symbol resolution for wildcard `_` patterns inside `member _.…` (#19760) * Make PR Tooling Safety Check resilient to GitHub MCP list_pull_requests timeouts (#19861) * Fix XmlDoc validation for get/set property pairs (#13684) (#19884) * Fix XmlDoc validation for get/set property pairs (#13684) Each accessor's xmlDoc is now validated against the union of both accessors' parameter names, eliminating spurious 'unknown parameter' and 'no documentation for parameter' warnings under --warnon:3390 when a property documents the full parameter set across getter and setter. * Fix #16360: stop duplicating editor diagnostics (revert Roslyn workaround) (#19812) * chore: update actions/github-script from v6 to v7 (#19843) * Fix #18086: suppress NuGet restore stdout under FSI --quiet (#19808) * Fix #18086: suppress NuGet restore stdout under FSI --quiet When --quiet (tcConfigB.noFeedback) is active, route the captured stdout of the NuGet restore subprocess to stderr instead of stdout so that warnings like NU1608 and MSBuild `Determining projects to restore...` chatter no longer pollute FSI stdout. Default (non-quiet) behavior is unchanged. result.StdError continues to go to stderr unconditionally. Co-authored-by: Copilot <[email protected]> * Add release notes entry for #18086 Co-authored-by: Copilot <[email protected]> * Apply remaining changes * Remove executor artifact --------- Co-authored-by: Copilot <[email protected]> * [main] Source code updates from dotnet/dotnet (#19887) * Make fsharp-diagnostics skill cross-platform (#19893) * Fix parser error for anonymous record type aliases with postfix type operators when closing bracket is column-aligned (#19762) * Initial plan * Fix anonymous record type alias with array/generic type suffix error when closing bracket is aligned with opening bracket Add BAR_RBRACE to isTypeSeqBlockElementContinuator in LexFilter.fs to prevent incorrect OBLOCKSEP insertion after closing |} in type alias contexts. This fixes the error 'Unexpected symbol [' in member definition' when writing: type T = {| Id: Guid |} [] // or |} seq, |} list, |} option Add tests covering the fixed cases in AnonymousRecords.fs. Agent-Logs-Url: https://github.com/dotnet/fsharp/sessions/efa54b78-f657-43e6-a50e-05db045cba9d Co-authored-by: T-Gro <[email protected]> * Add release notes for anonymous record type alias parser fix Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: T-Gro <[email protected]> Co-authored-by: Tomas Grosup <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Tomas Grosup <[email protected]> * Emit debug points at a stack-empty position (#19877) * Unify baseline checking behind a single checkBaseline helper (#19888) Introduce checkBaseline/checkBaselineWith in the Compiler test module and route the syntax-tree tests, surface-area verification, and the .err.bsl / .il.bsl / .vsbsl component-test baselines through it, replacing each site's own shouldUpdateBaselines check and ad-hoc file writes. The helper reads the baseline file, compares via a pluggable comparer (default exact equality; surface area and error baselines pass a set-based comparer, IL passes an ILChecker-based one), and on mismatch writes the produced content to an output file or updates the baseline when TEST_UPDATE_BSL is set. The output file extension is replaced for .bsl (foo.bsl -> foo.out) and appended otherwise (neg78.vsbsl -> neg78.vsbsl.out) so the .bsl/.vsbsl baselines a single test can have no longer collide. Removes the now-redundant updateBaseLineIfEnvironmentSaysSo, createBaselineErrors, convenienceBaselineInstructions, and assertBaseline, and drops the unused BaselineFile.FilePath field. This also fixes the IL baseline update path, which previously copied the previous run's IL to the baseline because the copy ran before the fresh actual was written. The SyntaxTree-local .gitignore (*.actual) is removed since those tests now write .out, covered by the global *.out rule. Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]> * Remove unused variable group (#19899) * Update dependencies from https://github.com/dotnet/arcade build 20260607.1 On relative base path root Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.26279.5 -> To Version 11.0.0-beta.26307.1 * Restore github.dev editor link in release-notes check comment (#19898) Co-authored-by: Copilot <[email protected]> * Add pr-description skill for short GitHub write-ups (#19891) Co-authored-by: Copilot <[email protected]> * Debug: rework `for` expressions stepping (#19894) * Sequence points: rework `for` stepping Step a for-each loop in source order: stop on the enumerable, then the element binding (covering `for <pattern>`), then the body; "getting the next element" is hidden. Add a sequence-point baseline test helper. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * Release notes * Update baselines --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]> * Warn on inconsistent [<CompiledName>] across extension overloads (#19737) * Detect inconsistent [<CompiledName>] across extension overloads (#19604) * Fix quotations leaking empty-string match lowering into AST (#19873) (#19923) * Move empty-string match optimization to Optimizer so quotations stay clean The empty-string lowering added in #19189 produced `if x <> null then x.Length = 0 else false` inside `BuildSwitch`, which leaked through pattern-match compilation into captured quotations (#19873). Move the rewrite to `OptimizeExprOp`, which already skips `Expr.Quote` bodies. `match s with "" -> _` keeps the same IL and quotations now see `op_Equality(s, "")`. As a side effect, `if s = "" then _` gets the same null-safe length-check IL — improvement, not regression. Also adds a generic `verifyOutputAgainstBaseline` helper in `Compiler.fs` and a `.bsl`-driven quotation rendering test suite under `Conformance/Expressions/ ExpressionQuotations/QuotationRendering/` to catch future leaks of pattern-match lowerings into quotation ASTs. Co-authored-by: Copilot <[email protected]> * Lock in IL trade-offs from rubber-duck review; tighten optimizer guard Adversarial reviews flagged two IL-quality concerns. Verified both by inspecting actual ildasm output, accepted both, and added IL tests locking the current behavior in so future changes are conscious: 1. --optimize- (debug) builds no longer get the null+Length fast path for `match s with "" -> _` because F#'s `(=)` is only inlined when LocalOptimizationsEnabled is true. The fallback `String.Equals(s,"")` call is still correct; JIT tiered compilation reaches the fast path. 2. `match s with null | "" -> _` emits one redundant `brfalse` on the empty-string branch because the optimizer cannot see the enclosing null-filtered context that BuildSwitch's `isNullFiltered` flag tracked. JIT trivially eliminates the redundant branch. Also tightens `IsILMethodRefSystemStringEquals` to require the call to be static (rejects hypothetical instance/user-defined `System.String` type with a 2-arg static `Equals`) and fixes a stale function-name comment in PatternMatchCompilation.fs. Co-authored-by: Copilot <[email protected]> * Polish quotation rendering test suite Driver: extract `printerProgram` helper using a triple-quoted F# string (no more `\"\"` escape hell); group tests into Regression / NoLeakReference / SideEffect / PreExistingError submodules. Baselines: drop the `Match` suffix (folder is already `QuotationRendering`), delete redundant `SparseIntMatch` (same code path as Consecutive), shrink all multi-case tests to the minimum that still demonstrates the point: - ConsecutiveInts: 1..10 → 1..3 (was 41 lines, now 7) - Chars, NonEmptyString: 3 → 2 cases - Int64, Float, Decimal: 3 → 1 case Result: 9 baselines totalling 37 lines, each fits on screen. Co-authored-by: Copilot <[email protected]> * Tighten test comments; collapse no-leak quotation tests to Theory The empty-string regression tests and surrounding trade-off comments grew beyond what they need to convey. This trims prose to the causal mechanism only, flattens four banner-only sub-modules into one, collapses the five no-leak reference tests into a parametrised Theory, and corrects a stale docstring claim that Int64/Float/Decimal each take a distinct BuildSwitch arm (Int64 and Float share the mkILAsmCeq path, so Float.bsl was redundant with Int64.bsl and is removed). Release note shrinks from a paragraph to the one user-observable change. Co-authored-by: Copilot <[email protected]> * Refactor quotation rendering tests to in-process literals after multi-architect review Three rounds of adversarial multi-model (gpt-5.5, opus-4.7-xhigh, opus-4.8) architect review converged on a cleaner design for the empty-string regression coverage: - Quotation literals now live directly in test method bodies (`<@ … @>`) instead of inside a generated FSI script. They are desugared at test-project compile time by the proto fsc, which converts a runtime baseline diff into a compile-time gate: if #19873 ever regresses, the test source itself fails to compile with FS0452. - Removes the shared-FSI session, the no-op `RunTestCasesInSequence` cargo cult, the string-templated printer with its triple-quote escape guard, and the unused `verifyOutputAgainstBaseline` helper this PR briefly introduced. - Baselines carry a `// <name>` provenance header so a `.bsl` opened in isolation identifies itself in PR diffs. - Adds an orphan-guard `[<Fact>]` that fails when `*.bsl` on disk drifts from the test method set (skipped during `TEST_UPDATE_BSL=1` to avoid racing with writes). - Adds a structural Expr walker as belt-and-suspenders alongside the baseline for the two known leaked-lowering shapes (`String.Length`, `String.Equals`). - Adds a convergence assertion that the `match x with ""` and `if x = ""` quotations desugar to byte-identical Exprs, using shared module-level let bindings so the proof and the baselines cannot drift apart. - Splits the FS0452 array-pattern diagnostic test into its own file since it uses a different harness (`FSharp |> typecheck |> shouldFail`, not a `.bsl` snapshot). Co-authored-by: Copilot <[email protected]> * Use tname_* constants instead of magic strings in IL method-ref matchers `tname_String`, `tname_Bool`, `tname_Type` already exist in `src/Compiler/AbstractIL/il.fs` as `[<Literal>]` constants alongside ~20 other type-name literals, but they were not exposed via `il.fsi` so callers in `Optimize/Optimizer.fs` and `Symbols/Exprs.fs` had been duplicating the magic strings (`"System.String"`, `"System.Boolean"`, `"System.Type"`). Exposes the three names actually referenced outside `il.fs` via `il.fsi` and switches the four affected `IL{TypeRef,MethodRef}.Name` comparisons to use them. No behavior change. The fix applies to the empty-string-equals matcher this PR added plus the pre-existing `String.Concat` / `String.GetHashCode` / `Type.GetTypeFromHandle` matchers. Co-authored-by: Copilot <[email protected]> * Trim bloated comments in QuotationRenderingTests.fs 5-line walker docstring, 3-line section-divider blocks, 6-line bullet list above the no-leak reference Facts, and a 12-line "Design notes" header were rationalising self-evident code or restating test names. Trimmed to the essentials: top-of-file purpose + bootstrap caveat, one-line note next to the shared `let` bindings, and the one genuinely-non-obvious comment (Int64 takes the mkILAsmCeq arm). Net effect: file shrinks from 156 to 100 lines, signal density up, tests unchanged. Co-authored-by: Copilot <[email protected]> * Remove orphan-baseline guard Fact It tested filesystem bookkeeping (does *.bsl on disk equal a hand-maintained expectedBaselines set), not the compiler. The drift it catches — a deleted test leaving its .bsl behind — is already visible in `git diff` and adds zero signal anyone would actually use to find a regression. Co-authored-by: Copilot <[email protected]> * Cut surviving garbage after multi-agent adversarial scan Three garbage hunters (production / tests / prose) found redundancies that slipped through the earlier iterations: Production: - Merge two String.Equals(_, "")/("", _) optimizer arms into one or-pattern. - Drop the redundant CallingConv.IsStatic guard in IsILMethodRefSystemStringEquals (ArgCount=2 + both args String + return Bool already pin the static overload). - Inline single-use let bindings in MakeOptimizedStringEqualsEmptyCall. - Shrink 4-line docstring to 2 lines; shrink match-arm comment to one line. - Shrink il.fsi block comment and PatternMatchCompilation.fs trade-off comment. Tests: - Delete QuotationUnsupportedConstructsTests.fs (FS0452 array-pattern coverage already exists in Regressions/E_DecomposeArray01.fs — pure duplication). - Delete IfEqualEmpty.bsl + its test + the convergence Fact + the shared `let` bindings + assertNoEmptyStringLowering walker; all duplicated EmptyString.bsl coverage either as identical AST or as belt-and-suspenders restating the baseline diff. - Strip the `// <name>` provenance header from the printer and from all 7 remaining baselines — the test method name already identifies each baseline. - Trim trade-off comment tails in TypeTestsInPatternMatching.fs (drop the JIT-folds-the-duplicate / tiered-compilation trivia). Release notes: drop the implementation-detail bullet about `if s = ""` getting the same null-safe IL — implied by moving the rewrite to the optimizer. Net: -115/+30 across 16 files. 14 tests still pass; build clean. Co-authored-by: Copilot <[email protected]> * Refactor String IL-method matchers via active pattern + InlineIfLambda Extracts a `(|StringTy|_|)` partial active pattern over `ILType` and a small `isILMethodRefOnSystemString` helper that bakes in `tname_String` as the declaring type and takes the per-arg-shape check as an `[<InlineIfLambda>]`. Each `IsILMethodRefSystem*` now reads as the literal shape it matches: `[StringTy; StringTy]` for Equals(string, string); the three overload arities of String.Concat as alternative list patterns; `[ILType.Array (shape, StringTy)]` for Concat(string[]). No `ArgCount` book-keeping or `List.forall` walks left. Behaviour unchanged: build clean, 14 quotation + IL tests still green. Co-authored-by: Copilot <[email protected]> * Address PR review + fix CI: drop misplaced comment, run quotations via FSI - PatternMatchCompilation.fs: remove the misplaced `// Empty-string is rewritten…` comment on the (now-pristine) string arm (review feedback from @abonie). - QuotationRenderingTests.fs: replace literal `<@…@>` quotations with source-string evaluation through a shared FSI session. The bootstrap fsc that builds the test project still has the pre-fix desugar and rejects literal `match s with ""` quotations with FS0452 — the literals only become valid AFTER this PR is in the bootstrap. FSI uses the just-built FCS (with the fix), so source-as-string evaluation is bootstrap-immune. The .bsl baselines are unchanged. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Adam Boniecki <[email protected]> * Fix degraded codegen for inner recursive functions under realsig (#19882) * Fix TLR under --realsig+ and closure constraint stripping Two codegen bugs fixed: 1. TLR (Top-Level Routing) was disabled under --realsig+ via a blanket short-circuit in InnerLambdasToTopLevelFuncs, causing inner recursive functions to be emitted as closure classes instead of static methods. This produced ~23× perf regression for struct mutual recursion (#17607). Fix: Remove the realsig band-aid. Instead, add a moduleCloc field to IlxGenEnv that always points to the enclosing non-generic module class. TLR-lifted vals (IsCompiledAsTopLevel && !IsMemberOrModuleBinding) are routed to moduleCloc, preventing them from inheriting class typars of a generic enclosing type. 2. Constrained inline generics, when inlined into closures, attached their constraints to the closure class's type params. The Specialize<T> override (from FSharpTypeFunc) must be unconstrained to match its base signature. When constraints leaked, the JIT threw TypeLoadException (#14492). Fix: In EraseClosures CASE 1, strip constraints from both the Specialize override method-typars (CASE 1b) and the later closure class-typars (CASE 1a) at the CASE 1 head. Rewrite stripILGenericParamConstraints via mkILSimpleTypar to be future-proof (clears all constraint fields including CustomAttrsStored which carries IsUnmanagedAttribute). Co-authored-by: Copilot <[email protected]> * Fix verifyILContains silent failure, add checkILPresent/checkILNotPresent HOF - verifyILContains now throws on mismatch instead of silently returning CompilationResult.Failure (which callers were ignoring with |> ignore). - Unify checkILPresent/checkILNotPresent via shared checkILFragments HOF. - Expose verifyILPresent in Compiler.fs (symmetric with verifyILNotPresent). - Fix TypeTests.fs assertions exposed by the silent-failure fix. Co-authored-by: Copilot <[email protected]> * Add tests and regenerate IL baselines for TLR/constraint fixes New test files: - Regression_TLR_MutualInnerRec_StructuralAssertions.fs: 20 tests covering TLR scenarios (generic class, nested module, three-way rec, quotation, value rec) and constraint stripping (IL shape, ILVerify, >5 params CASE 2a, combined TLR+constraint). All run under both realsig on/off. - Regression_Specialize_ConstraintVerification.fs: 14 tests exercising each ILGenericParameterDef field stripped by mkILSimpleTypar (struct, not struct, unmanaged, new(), interface, comparison, combined) via ILVerify + run. - 4 new IL-baseline source files (mutual rec, captured env, generic, Point2D) with Off/On .il.bsl pairs confirming realsig parity. Regenerated baselines: - TestFunction06, TestFunction23: closures replaced by static methods - Match01: clo@4 closure removed (TLR fires under realsig+) - Unmanaged: virtual DirectInvoke → static func@3 Note: Match01 and TestFunction23 .net472.bsl baselines need TEST_UPDATE_BSL=1 regeneration on Windows CI (macOS cannot target net472). Co-authored-by: Copilot <[email protected]> * Release notes for TLR realsig fix (#17607) and constraint stripping fix (#14492) Co-authored-by: Copilot <[email protected]> * Add PR link to release notes and fix code formatting - Add PR #19882 link to both release note entries - Apply fantomas formatting to il.fs and IlxGen.fs Co-authored-by: Copilot <[email protected]> * Fix FS2014 duplicate-name when TLR routes namespace-level vals to moduleCloc When moduleCloc has empty Enclosing (namespace-level / types-only file), the previous routing fell through TypeRefForCompLoc to <PrivateImplementationDetails$AsmName>, a single per-assembly type. Multiple files each with an inner-rec function having the same compiler-generated name (e.g. capture@N in two FSharpEmbedResource-derived modules of FSharp.Build) all dumped into that shared bucket and collided in the IL method table, producing FS2014 `duplicate entry 'capture@83' in method table` at write-time during the bootstrap compilation of FSharp.Build and FSharp.DependencyManager.Nuget under --realsig+. Fix: when moduleCloc.Enclosing is empty, route through CompLocForInitClass instead. TypeNameForInitClass embeds TopImplQualifiedName (per-file) so the lifted val lands in <StartupCode$AsmName>.$FileName, matching the pre-realsig codegen layout and giving the per-file isolation that prevents collisions. The Container<'T>-style fix (moduleCloc with non-empty Enclosing) is preserved unchanged. Verified by rebuilding the compiler with -bootstrap -buildnorealsig:$false; both FSharp.Build.dll and FSharp.DependencyManager.Nuget.dll compile clean. Adds a regression test in Regression_TLR_MutualInnerRec_StructuralAssertions that fails on the previous version and passes after this fix. Co-authored-by: Copilot <[email protected]> * Update stale IL baselines surfaced by CI after the moduleCloc routing fix Regenerated from build 1449384 actual IL output: - TestFunction23.fs.RealInternalSignatureOn.OptimizeOn.il.net472.bsl - Match01.fs.RealInternalSignatureOn.il.net472.bsl - Regression_TLR_MutualInnerRec_Point2D.fs.RealInternalSignatureOff.il.bsl - Regression_TLR_MutualInnerRec_Point2D.fs.RealInternalSignatureOn.il.bsl The first two were known stale per the PR description (net472 needs TEST_UPDATE_BSL on Windows CI). The Point2D baselines drift was caused by the duplicate-name fix changing the routing of TLR-lifted vals at namespace-level to the per-file init class. Co-authored-by: Copilot <[email protected]> * Re-extract Point2D baselines from Linux CI log (use Entire actual: marker) Previous extraction grabbed only the first chunk of paginated Actual: output; the correct full IL appears after the "Entire actual:" sentinel. Linux's Point2D baselines are now consistent for both realsig settings. Co-authored-by: Copilot <[email protected]> * Normalize ldc.r8 N vs ldc.r8 N. in ILChecker for shared .bsl files Windows ildasm 5.x prints whole-number float literals with a trailing dot (`ldc.r8 10.`), Linux ildasm strips the dot entirely (`ldc.r8 10`). Without normalization, any .bsl file with floats inevitably fails on one platform — observed on the new Point2D regression test. The new `unifyFloatLiterals` rule rewrites bare `ldc.r8 -?N` to the dotted form for both expected and actual, keeping comparisons platform- agnostic without forcing baselines to be regenerated per OS. Co-authored-by: Copilot <[email protected]> * Address adversarial review feedback (opus 4.8, opus 4.7 xhigh, gpt 5.5) Comment trimming (all 3 reviewers flagged): - IlxGen.AllocValReprWithinExpr: 9-line block down to 2 lines - IlxGen.moduleCloc field doc + AddEnclosingToEnv: one-liners - EraseClosures CASE 1 unconstrainedGenParams: 3-line narrative down to 1 - Regression_TLR_MutualInnerRec_StructuralAssertions: closureWithConstraint header, namespace-collision test doc, and inline assertion comments - Regression_Specialize_ConstraintVerification module doc: 16 lines down to 3 - ILChecker.unifyFloatLiterals: 3-line comment + redundant (?!\.) regex lookahead Correctness / clarity: - AbstractIL.stripILGenericParamConstraints: keep explicit field-by-field clear with CustomAttrsStored reset, accurate doc — the previous mkILSimpleTypar rewrite silently dropped Variance/MetadataIndex semantics that the comment did not mention - InnerLambdasToTopLevelFuncs: collapse two adjacent Some(f, arity) branches into one predicate (atTopLevel || arity <> 0 || not (isNil tps)) - Combined TLR+constraint test: actually assert constraint stripping (Specialize<class/valuetype patterns) — previously only checked the search@ symbol - TypeTests.fs `M(()) and M() produce same IL method signature`: test name was a silent-failure relic from before verifyILContains threw — assertion clearly shows Unit and int are distinct signatures. Renamed and pointed at #19615. - Drop the now-redundant `Issue 14492: >5 params closure chain produces D-suffix and unconstrained Specialize` Specialize/T duplication — the dedicated test next to it already covers that path; this one keeps the D-suffix-only assertion. No production-code behaviour change beyond field-by-field stripping in stripILGenericParamConstraints; CI baselines unaffected. Co-authored-by: Copilot <[email protected]> * Address production-grade reuse review (opus 4.8, opus 4.7 xhigh, gpt 5.5) Tests: - Extract shared `verifyPEAndRun` helper (GPT-5.5: duplicated PEFile + run tail across compileVerifyAndRun and both inline >5-params and Combined test bodies) - Combined test: drop `object Specialize<` positive assertion — the inlined constraint produces no Specialize<> for this closure shape, so the previous assertion broke Linux CI (build 1451155). Negative `Specialize<class`/ `Specialize<valuetype` checks are kept and remain meaningful (vacuously true when no Specialize is emitted, real if one ever appears with leaked constraint). Compiler: - IlxGen.GetEmptyIlxGenEnv + GenerateCode: bind `ccuLoc`/`fragLoc` once instead of computing CompLocForCcu/CompLocForFragment twice per record literal (GPT-5.5: cloc/moduleCloc pairing easy to desynchronize). Deferred (after triage): - verifyILContains vs verifyILPresent rename — all 3 reviewers flagged the name overlap, but the rename touches ~100 callers across the test suite, out of scope for this PR. Both helpers now throw on mismatch (silent failure already fixed); the matching-semantics difference will be documented separately. - withQName near-duplicate with line 1918-1921 cloc reset — sites differ in Range semantics (the latter intentionally omits Range update for FSI fragments), so a shared helper would add overhead more than it removes. Co-authored-by: Copilot <[email protected]> * Address expert-review feedback (post-merge from origin/main) Refute and dismiss B1 ("debug-stepping clobber"): PR #19894 (d0e593f67) landed on origin/main on 2026-06-08 13:11, three days AFTER my last merge on 2026-06-05 11:35. None of my commits (775771769, e2ed10f45, f933f8308) touch the relevant IlxGen.fs lines. Merged origin/main now brings the fix in — verified `if equals m range0` is present at IlxGen.fs:3178 and :3743 in the working tree. Apply M3: Release notes now cite #19075 in the constraint-stripping entry (test `SRTP member constraint with IDisposable` explicitly targets that issue's CLR segfault). Soften M2: Drop the unverified "≈23x" specific number from release notes; the perf magnitude is documented in #17607 itself with the original repro. Apply L2: `unmanaged + equality` test now asserts no `Specialize<valuetype (...modreq...)` or `T<valuetype (...modreq...)` leakage — exercises the IsUnmanagedAttribute / modreq stripping path that motivated the CustomAttrsStored clear in stripILGenericParamConstraints. Co-authored-by: Copilot <[email protected]> * Collapse byte-identical Off/On TLR baselines into shared single .bsl The 4 new TLR regression tests (Regression_TLR_MutualInnerRec, _CapturedEnv, _Generic, _Point2D) emit byte-identical IL under --realsig+ and --realsig-, which was previously expressed as two duplicated .bsl files per test (_.RealInternalSignatureOff.il.bsl + _.RealInternalSignatureOn.il.bsl). Replace each pair with a single shared file: <test>.fs.il.bsl. The bsl lookup chain in FileInlineDataAttribute.fs:94-106 already falls through to the bare .il.bsl after exhausting realsig-suffixed candidates, so both Realsig=Off and Realsig=On invocations now compare against the same file. Identity becomes a structural property of the test layout instead of a coincidence between two separately-maintained baselines. Reduces baseline byte count by ~50% for these tests and makes any future realsig divergence an immediate failure (the…
1 parent 1357c8d commit dfd0e1d

259 files changed

Lines changed: 19804 additions & 9975 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/copilot-instructions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ Before submitting: `./build.sh -c Release --testcoreclr`
4848
.fs: implementation
4949
.fsi: declarations, API docs, context comments
5050

51+
Abbreviations (`ad`, `cenv`, `m`, `tcref`, `eenv`, `cgbuf`, `ncenv`, `tau`, …): see `docs/coding-standards.md` for the canonical glossary before guessing what a short identifier means.
52+
5153
## Rules
5254

5355
Public API change → update .fsi

.github/docs/state-machine.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,24 @@ stateDiagram-v2
134134
[*] --> ScanQueue: ⏰ labelops-pr-security-scan (1h)
135135
136136
state "Per-PR Classification" as ScanLoop {
137-
ScanQueue --> ReadRules: 🤖 security-scan reads repo rules
138-
ReadRules --> CheckDraft: 🤖 security-scan checks isDraft
137+
ScanQueue --> ReadRules: 🤖 security-scan reads repo rules + memory
138+
ReadRules --> CheckDate: 🤖 security-scan paginates PRs (newest first)
139+
140+
state datecheck <<choice>>
141+
CheckDate --> datecheck
142+
datecheck --> SkipOld: PR before date cutoff
143+
datecheck --> CheckDraft: PR within scan window
144+
145+
SkipOld --> [*]: skip
139146
140147
state draftcheck <<choice>>
141-
CheckDraft --> draftcheck
148+
CheckDraft --> draftcheck: 🤖 security-scan checks isDraft
142149
draftcheck --> SkipDraft: draft PR
143150
draftcheck --> CheckMemory: non-draft PR
144151
145152
SkipDraft --> [*]: skip
146153
147-
CheckMemory --> CheckMemory2: 🤖 security-scan reads state.json
154+
CheckMemory --> CheckMemory2: 🤖 security-scan checks state.json sha
148155
149156
state memcheck <<choice>>
150157
CheckMemory2 --> memcheck
@@ -255,7 +262,7 @@ stateDiagram-v2
255262
aw-auto-update.md: da8c5e340a43d73616e3a0203c7e56de9ca4b82ee78b1902afe466a49a08bc17
256263
labelops-flake-fix.md: 7dca5b8faa60f947204f8925c6238fbecf42aa8cbf3144a166120501b0eef1e4
257264
labelops-pr-maintenance.md: 59ba52fc625e0b9112c31864e92154cdf09acf0bc0f2b167aa30a0d76baa898f
258-
labelops-pr-security-scan.md: 675430850eaf8edaa86b4d26c9d381ac48e13536469f17748e7104f6e75937c2
265+
labelops-pr-security-scan.md: 7dd4063d35d2bac6b0edf238e72a1ffe2570d0102340dab8064bf1de9ec73ac7
259266
regression-pr-shepherd.md: 18a65fe1cdf8aa219158f1d610db14078e5ff2f1ac912df2566bf796792395b5
260267
repo-assist.md: 3775b51d142d22c98e87e48e8ac9d46cdf69e9c8306d5787758a35578dcb1119
261268
-->
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
applyTo:
3+
- "src/Compiler/**/*.{fs,fsi}"
4+
- "vsintegration/src/**/*.{fs,fsi}"
5+
- "tests/FSharp.Compiler.ComponentTests/**/*.fs"
6+
- "tests/FSharp.Compiler.Service.Tests/**/*.fs"
7+
- "vsintegration/tests/**/*.fs"
8+
---
9+
10+
# Code Style: No Bloat
11+
12+
Reviewers read code, not prose. Add bytes only when they pay for themselves.
13+
14+
## Comments
15+
16+
Good names **always** beat comments. Before writing a comment, ask: *can I rename a value, extract a function, or use an active pattern so the comment becomes unnecessary?* If yes, do that instead.
17+
18+
- **Do not** restate what the code says (variable name, type name, attribute name, function signature).
19+
- **Do not** narrate the algorithm step-by-step. The diff is the algorithm.
20+
- **Do not** justify design decisions inline ("we chose X over Y because…"). Put rationale in the commit message or PR body.
21+
- **Do not** leave war-story comments ("previously we did Z, but…", "counter-example: …"). The history is in `git log`.
22+
- **Do not** write multi-line `///` doc comments for internal helpers whose body is one expression.
23+
24+
Acceptable comments answer **why**, not **what**, and only when the *why* is non-obvious and cannot be expressed by renaming:
25+
- Workarounds for compiler/runtime bugs (link the bug).
26+
- Performance constraints invisible from the code shape ("inner loop runs 50M times per typecheck").
27+
- Cross-file invariants the code itself can't enforce.
28+
29+
If you are tempted to write `// This is intentional`, change the code so the intent is structural, not decorative.
30+
31+
## Code shape
32+
33+
- Compact, idiomatic F#: pattern matching over `if`/`elif` ladders; active patterns where they remove duplication.
34+
- Low cyclomatic complexity per function. Extract helpers — even one-line ones — when a name clarifies a step.
35+
- Prefer module-level `let` over big bodies with nested locals.
36+
- New file > bloating an existing 5000-line file when adding a self-contained concept.
37+
38+
## Test code
39+
40+
Tests get a touch more leeway for explanation, but the same rules largely apply:
41+
42+
- One parametrized test (`[<Theory>]`, `[<InlineData>]`, or a `for/yield` over inputs) > five copy-pasted tests.
43+
- Module-level constants for shared paths (`Path.Combine` for OS neutrality), shared source strings, and shared expected outputs.
44+
- Helpers like `parseAndCheck code` over reinventing the setup per test.
45+
- Don't reinvent an entire `.fs` file inside each test when one shared module-level binding will do.
46+
47+
## PR scope
48+
49+
**Not paid by LOC.** Large PRs are typically shitty PRs. If the diff has 1000+ lines, split it.
50+
- Cleanup commits separate from feature commits.
51+
- No "phase tag" / "transitional measure" / "follow-up" comments left behind — either do it now in a follow-up commit, or file an issue. Don't leave breadcrumbs in the code.
52+
53+
## When in doubt
54+
55+
Delete the comment, rename the value, and re-read. If the code is still unclear, *that* is what needs fixing — not the comment.
Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,56 @@
11
---
22
name: fsharp-diagnostics
3-
description: "Always invoke after editing .fs files. Provides fast parse/typecheck feedback without a full dotnet build. Prefer this over dotnet build for iterative changes. Also finds symbol references and inferred type hints."
3+
description: Always invoke after editing `.fs` files under `src/Compiler/`. Fast parse/typecheck without `dotnet build`, plus symbol references and inferred type hints. Use whenever the user asks about F# errors, compile errors, type inference, finding usages, or renaming a symbol in the compiler tree.
44
---
55

66
# F# Diagnostics
77

8-
**Scope:** `src/Compiler/` files only (`FSharp.Compiler.Service.fsproj`, Release, net10.0).
8+
**Scope:** `src/Compiler/` files only.
99

10-
## Setup (run once per shell session)
10+
## Setup (once per session)
1111

12-
```bash
13-
GetErrors() { "$(git rev-parse --show-toplevel)/.github/skills/fsharp-diagnostics/scripts/get-fsharp-errors.sh" "$@"; }
12+
Requires pwsh 7+ (`brew install powershell` / `winget install Microsoft.PowerShell` / `apt install powershell`).
13+
14+
```pwsh
15+
function GetErrors { & "$(git rev-parse --show-toplevel)/.github/skills/fsharp-diagnostics/scripts/get-fsharp-errors.ps1" @args }
1416
```
1517

18+
From bash/zsh without a function: `pwsh -File <repo>/.github/skills/fsharp-diagnostics/scripts/get-fsharp-errors.ps1 <args>`.
19+
1620
## Parse first, typecheck second
1721

18-
```bash
19-
GetErrors --parse-only src/Compiler/Checking/CheckBasics.fs
20-
```
21-
If errors → fix syntax. Do NOT typecheck until parse is clean.
22-
```bash
23-
GetErrors src/Compiler/Checking/CheckBasics.fs
22+
```pwsh
23+
GetErrors -ParseOnly src/Compiler/Checking/CheckBasics.fs # syntax only
24+
GetErrors src/Compiler/Checking/CheckBasics.fs # full typecheck
2425
```
26+
Fix all parse errors before typechecking; type errors on top of bad syntax are noise.
2527

26-
## Find references for a single symbol (line 1-based, col 0-based)
28+
## Symbol references (line 1-based, col 0-based)
2729

28-
Before renaming or to understand call sites:
29-
```bash
30-
GetErrors --find-refs src/Compiler/Checking/CheckBasics.fs 30 5
30+
```pwsh
31+
GetErrors -FindRefs src/Compiler/Checking/CheckBasics.fs 30 5
3132
```
33+
Use before any rename.
3234

33-
## Type hints for a range selection (begin and end line numbers, 1-based)
35+
## Type hints (line range, 1-based)
3436

35-
To see inferred types as inline `// (name: Type)` comments:
36-
```bash
37-
GetErrors --type-hints src/Compiler/TypedTree/TypedTreeOps.fs 1028 1032
37+
Returns the range with inferred types as inline `// (name: Type)` comments:
38+
```pwsh
39+
GetErrors -TypeHints src/Compiler/TypedTree/TypedTreeOps.Transforms.fs 100 120
3840
```
3941

4042
## Other
4143

42-
```bash
43-
GetErrors --check-project # typecheck entire project
44-
GetErrors --ping
45-
GetErrors --shutdown
44+
```pwsh
45+
GetErrors -CheckProject # typecheck entire project
46+
GetErrors -Ping # liveness check, no side effects
47+
GetErrors -Shutdown
4648
```
4749

48-
First call starts server (~70s cold start, set initial_wait=600). Auto-shuts down after 4h idle. ~3 GB RAM.
50+
## Timing
51+
52+
- First real call after a fresh clone: server build + in-memory warmup, 5–15 min → `initial_wait=1200`.
53+
- After warmup: real commands answer in seconds → `initial_wait=180`.
54+
- `-Ping` / `-Shutdown`: sub-second; never trigger build or warmup.
55+
56+
Auto-shuts down after 4h idle; ~3 GB RAM while running.

0 commit comments

Comments
 (0)