-
Notifications
You must be signed in to change notification settings - Fork 849
Add Prime and Nu to regression test matrix; fix graph resolution Module+Module merge #19280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
10
commits into
main
Choose a base branch
from
copilot/add-fsharp-test-entries
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+257
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: T-Gro <[email protected]>
Copilot
AI
changed the title
[WIP] Add two F# projects to regression test matrix
Add Prime and Nu to compiler regression test matrix
Feb 12, 2026
When two files define the same module name in the same namespace (e.g., module Assets in namespace Nu across Core/Assets.fs and World/WorldAssets.fs), mergeTrieNodes' fallback case kept only the first file's index, losing the second. This caused missing dependency edges in the graph-based parallel type checker, leading to FS0039 errors when files were typechecked before their dependencies. Fix: Add an explicit Module+Module case that promotes to a Namespace node preserving both file indices in filesThatExposeTypes, following the existing Module+Namespace merge pattern. Added three test scenarios covering sub-namespace access patterns and the duplicate module name case.
- Add scenario for type constructor usage through open parent namespace - Add scenario for multiple namespace declarations in one file with AutoOpen - Add descriptive comments explaining test groups and Module+Module fix rationale - All 48 dependency resolution tests and 96 compilation tests pass
Address TEST-COVERAGE gap: the existing 'Two modules with the same name' test only had 2 files, so mkTrie (which skips the last file) never exercised the Module+Module merge branch in mergeTrieNodes. Add three targeted tests: - Module+Module merge preserves both file indices (3 files) - Module+Module merge across three files (4 files, 3 sharing name) - Module+Module merge preserves children from both sides
- TrieMappingTests: Assert merged node is Namespace with correct filesThatExposeTypes (not just Files property) - DependencyResolutionTests: Add focused test verifying Module+Module merge creates dependency edges to both defining files
- Remove standalone Module+Module merge Fact test from DependencyResolutionTests.fs (duplicated scenario-based coverage, used Contains instead of set equality) - Extract assertModuleMergePromotesToNamespace helper in TrieMappingTests - Combine 2-file and 3-file Module+Module merge tests into a single parameterized Theory test
Contributor
❗ Release notes required
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds two F# projects to the regression test pipeline, and fixes a bug discovered through them in graph-based parallel type checking.
Bug fix: Module+Module merge in
TrieMappingWhen two files in the same namespace define a module with the same name (a legal F# pattern using
CompilationRepresentationFlags.ModuleSuffix), the trie-based dependency graph failed to merge them. The secondModulenode silently replaced the first, losing its file index. Files in child namespaces thatopen-ed the parent then got an incomplete dependency set, leading to type-check errors under parallel compilation (graph-based checking).Problematic pattern from the Nu game engine
Fix
Added a
Module(_,file1), Module(_,file2)match arm inmergeTrieNodesthat promotes the pair to aNamespacenode, preserving both file indices—matching the existingModule, Namespacehandling.Regression test matrix
Added to
azure-pipelines-PR.yml:8d55f4e8e1d76e42f5fb3c9ba69eb79fe695e9fab35cbe02029e0e33d72a4846816cf22714eb3aac