Skip to content

Fix spurious type errors for provided types under parallel compilation#19969

Open
T-Gro wants to merge 2 commits into
dotnet:mainfrom
T-Gro:fix/tp-tcimport
Open

Fix spurious type errors for provided types under parallel compilation#19969
T-Gro wants to merge 2 commits into
dotnet:mainfrom
T-Gro:fix/tp-tcimport

Conversation

@T-Gro

@T-Gro T-Gro commented Jun 18, 2026

Copy link
Copy Markdown
Member

Two type-provider failures that appear only in full parallel builds, not in the IDE:

  • The same provided type used from multiple files was checked into separate entities, so identity comparisons failed and reported spurious FS0001 type mismatches. Provided-type entities are now interned by name, so all files linking a given provided type share one entity and parallel checking stays enabled.

  • Hosting a TypeProviders-SDK provider under an unoptimized compiler failed with "a field called tcImports must exist in the systemRuntimeContainsType closure", because the closure field the SDK reflects on was named by codegen and only matched in optimized builds. It is now captured stably in every configuration.

Intern provided-type entities by name so the same provided type linked from
multiple files under graph-based parallel checking yields one entity, avoiding
spurious FS0001 type mismatches from identity comparisons.

Capture the systemRuntimeContainsType closure stably so TypeProviders-SDK
providers load under an unoptimized compiler (the SDK reflects on a field
named tcImports whose name was previously codegen-dependent).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… fixes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@T-Gro T-Gro requested a review from abonie June 18, 2026 13:15
@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

✅ No release notes required

@T-Gro

T-Gro commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

CC @smoothdeveloper — thanks for the report and the debugging that pinned this down.

@smoothdeveloper

smoothdeveloper commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

@T-Gro thanks for getting to the bottom of it!

I'll check the changes solves the issue in my context (edit: change to CompilerImports.fs is in the PR already).

@github-actions github-actions Bot added ⚠️ Affects-Design-Time Tooling check: PR touches type providers or dependency manager ⚠️ Affects-Compiler-Output Tooling check: PR touches IL emission or codegen labels Jun 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Tooling Safety Check — Affects-Compiler-Output, Affects-Design-Time
Affects-Compiler-Output: ProviderGeneratedTypeRoots sort order changed; closure IL shape differs
Affects-Design-Time: type-provider interning/hosting infrastructure modified

Generated by PR Tooling Safety Check · opus46 5.4M ·

@smoothdeveloper

Copy link
Copy Markdown
Contributor

Confirming the build issue is fixed in my context!

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

Labels

⚠️ Affects-Compiler-Output Tooling check: PR touches IL emission or codegen ⚠️ Affects-Design-Time Tooling check: PR touches type providers or dependency manager

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

2 participants