Skip to content

Relax Patch(record, updates...) field-type strictness and preserve unioned record shape#3063

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-patch-coercion-restrictions
Draft

Relax Patch(record, updates...) field-type strictness and preserve unioned record shape#3063
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-patch-coercion-restrictions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 19, 2026

Patch({a:1,b:"hello"}, {a:3,b:4}) failed because the record overload required exact type matches for overlapping fields across update records. This change relaxes that rule so record patching can evolve field types while still computing a consistent return record type.

  • Record-overload type-checking change

    • Updated PatchRecordFunction.CheckTypes to stop rejecting updates when an existing field appears with a different type.
    • Kept non-record argument validation intact.
    • Return type is now derived by unioning base/update record types across all update arguments, even when overlapping field kinds differ.
  • Regression coverage for record patching

    • Added focused tests in TexlTests.cs for:
      • literal record patching with new and overlapping fields
      • overlapping field type changes (e.g., b:n -> b:s)
      • variable-based record patching, including Unknown ($) fields
    • Updated variable-based test inputs to pass variable names explicitly (avoids brittle parsing from expression text).
Patch({a:1, b:2}, {b:"3", c:4})
// now binds as: ![a:n, b:s, c:n]

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

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

  • 1mcvsblobprodwus2174.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/Power-Fx/Power-Fx/src/Microsoft.PowerFx.sln --packages /tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)
  • 5bdvsblobprodwus2128.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/Power-Fx/Power-Fx/src/Microsoft.PowerFx.sln --packages /tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)
  • 5o1vsblobprodwus2115.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter TexlPatchWithDataSourceArgumentValidation --nologo (dns block)
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter TestPatchRecordFunction|TexlPatchWithDataSourceArgumentValidation --nologo (dns block)
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter FullyQualifiedName~TestPatchRecordFunction --nologo (dns block)
  • 5zivsblobprodwus217.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter TexlPatchWithDataSourceArgumentValidation --nologo (dns block)
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter TestPatchRecordFunction|TexlPatchWithDataSourceArgumentValidation --nologo (dns block)
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter FullyQualifiedName~TestPatchRecordFunction --nologo (dns block)
  • 6yfvsblobprodwus2121.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter TexlPatchWithDataSourceArgumentValidation --nologo (dns block)
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter TestPatchRecordFunction|TexlPatchWithDataSourceArgumentValidation --nologo (dns block)
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter FullyQualifiedName~TestPatchRecordFunction --nologo (dns block)
  • 7t8vsblobprodwus2168.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/Power-Fx/Power-Fx/src/Microsoft.PowerFx.sln --packages /tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)
  • ezcvsblobprodwus2170.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter TexlPatchWithDataSourceArgumentValidation --nologo (dns block)
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter TestPatchRecordFunction|TexlPatchWithDataSourceArgumentValidation --nologo (dns block)
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter FullyQualifiedName~TestPatchRecordFunction --nologo (dns block)
  • faxvsblobprodwus2122.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter TexlPatchWithDataSourceArgumentValidation --nologo (dns block)
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter TestPatchRecordFunction|TexlPatchWithDataSourceArgumentValidation --nologo (dns block)
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter FullyQualifiedName~TestPatchRecordFunction --nologo (dns block)
  • i01vsblobprodwus216.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter TexlPatchWithDataSourceArgumentValidation --nologo (dns block)
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter TestPatchRecordFunction|TexlPatchWithDataSourceArgumentValidation --nologo (dns block)
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter FullyQualifiedName~TestPatchRecordFunction --nologo (dns block)
  • jhgvsblobprodwus2167.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/Power-Fx/Power-Fx/src/Microsoft.PowerFx.sln --packages /tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)
  • ldhvsblobprodwus2153.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter TexlPatchWithDataSourceArgumentValidation --nologo (dns block)
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter TestPatchRecordFunction|TexlPatchWithDataSourceArgumentValidation --nologo (dns block)
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter FullyQualifiedName~TestPatchRecordFunction --nologo (dns block)
  • ndavsblobprodwus219.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/Power-Fx/Power-Fx/src/Microsoft.PowerFx.sln --packages /tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)
  • s0ivsblobprodwus2134.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter TexlPatchWithDataSourceArgumentValidation --nologo (dns block)
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter TestPatchRecordFunction|TexlPatchWithDataSourceArgumentValidation --nologo (dns block)
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter FullyQualifiedName~TestPatchRecordFunction --nologo (dns block)
  • vd2vsblobprodwus2150.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/Power-Fx/Power-Fx/src/Microsoft.PowerFx.sln --packages /tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)
  • wztvsblobprodwus2155.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter TexlPatchWithDataSourceArgumentValidation --nologo (dns block)
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter TestPatchRecordFunction|TexlPatchWithDataSourceArgumentValidation --nologo (dns block)
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter FullyQualifiedName~TestPatchRecordFunction --nologo (dns block)
  • x0dvsblobprodwus2111.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/Power-Fx/Power-Fx/src/Microsoft.PowerFx.sln --packages /tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/Power-Fx/Power-Fx/src/libraries/Microsoft.PowerFx.LanguageServerProtocol/Microsoft.PowerFx.LanguageServerProtocol.csproj --packages /tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/Power-Fx/Power-Fx/src/libraries/Microsoft.PowerFx.Json/Microsoft.PowerFx.Json.csproj --packages /tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)
  • y5lvsblobprodwus2179.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter TexlPatchWithDataSourceArgumentValidation --nologo (dns block)
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter TestPatchRecordFunction|TexlPatchWithDataSourceArgumentValidation --nologo (dns block)
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter FullyQualifiedName~TestPatchRecordFunction --nologo (dns block)
  • z2bvsblobprodwus2185.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter TexlPatchWithDataSourceArgumentValidation --nologo (dns block)
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter TestPatchRecordFunction|TexlPatchWithDataSourceArgumentValidation --nologo (dns block)
    • Triggering command: /usr/bin/dotnet dotnet test /home/REDACTED/work/Power-Fx/Power-Fx/src/tests/.Net7.0/Microsoft.PowerFx.Core.Tests/Microsoft.PowerFx.Core.Tests.csproj --filter FullyQualifiedName~TestPatchRecordFunction --nologo (dns block)
  • zd2vsblobprodwus2156.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/Power-Fx/Power-Fx/src/Microsoft.PowerFx.sln --packages /tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/Power-Fx/Power-Fx/src/libraries/Microsoft.PowerFx.Connectors/Microsoft.PowerFx.Connectors.csproj --packages /tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)
  • zugvsblobprodwus2169.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/Power-Fx/Power-Fx/src/Microsoft.PowerFx.sln --packages /tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/Power-Fx/Power-Fx/src/libraries/Microsoft.PowerFx.LanguageServerProtocol/Microsoft.PowerFx.LanguageServerProtocol.csproj --packages /tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/Power-Fx/Power-Fx/src/libraries/Microsoft.PowerFx.Connectors/Microsoft.PowerFx.Connectors.csproj --packages /tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-65e5a7552fae7ad7/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)

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

Copilot AI and others added 2 commits May 19, 2026 18:19
Agent-Logs-Url: https://github.com/microsoft/Power-Fx/sessions/06ca3f33-4583-4197-9410-940f498c6d89

Co-authored-by: CarlosFigueiraMSFT <44986255+CarlosFigueiraMSFT@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/Power-Fx/sessions/06ca3f33-4583-4197-9410-940f498c6d89

Co-authored-by: CarlosFigueiraMSFT <44986255+CarlosFigueiraMSFT@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Patch function to allow coercions from second item to first Relax Patch(record, updates...) field-type strictness and preserve unioned record shape May 19, 2026
Copilot AI requested a review from CarlosFigueiraMSFT May 19, 2026 18:24
@CarlosFigueiraMSFT
Copy link
Copy Markdown
Contributor

Please add a few entries where coercion is required to the .txt tests at src\tests\Microsoft.PowerFx.Core.Tests.Shared\ExpressionTestCases\Patch_PatchRecord.txt - and make sure that they pass

@CarlosFigueiraMSFT
Copy link
Copy Markdown
Contributor

CarlosFigueiraMSFT commented May 19, 2026

Please add a few entries where coercion is required to the .txt tests at src\tests\Microsoft.PowerFx.Core.Tests.Shared\ExpressionTestCases\Patch_PatchRecord.txt - and make sure that they pass

For example:

>> Patch({a:1, b:2}, {b:"3", c:4}))
{a:1,b:3,c:4}

>> Patch({a:1, b:"hello"}, {a:3, b:4})
{a:1,b:"4"}

@copilot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Patch(<record1>, <record2>) should allow coercions from the second item to the first

2 participants