C#: Default test framework to Net90 reference assemblies#7071
Merged
knutwannheden merged 2 commits intomainfrom Mar 20, 2026
Merged
C#: Default test framework to Net90 reference assemblies#7071knutwannheden merged 2 commits intomainfrom
Net90 reference assemblies#7071knutwannheden merged 2 commits intomainfrom
Conversation
…ribution RecipeSpec now defaults ReferenceAssemblies to Assemblies.Net90 so tests get type attribution without requiring every test to explicitly call SetReferenceAssemblies(). Tests can opt out via SetReferenceAssemblies(null). Also fix WhitespaceReconciler to skip JavaType properties at the reflection level rather than at runtime. The reconciler previously bailed on structural mismatch when the original tree had type info but the re-parsed formatted tree did not. Since JavaType is metadata, not AST structure, these properties should not be visited at all.
Net90 reference assemblies
ResolveAsync is expensive (~5-10s) and returns the same result for the same ReferenceAssemblies instance. Cache it in a static ConcurrentDictionary so it's only resolved once per assembly set.
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
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
RecipeSpec.ReferenceAssembliestoAssemblies.Net90so C# tests get type attribution without requiring every test to explicitly callSetReferenceAssemblies()SetReferenceAssemblies(null)for tests that specifically want no type infoWhitespaceReconcilerto skipJavaTypeproperties at the reflection level inGetReconcilableProperties, rather than with a runtimeis JavaTypecheck that missed the case where the original had types but the re-parsed formatted tree did not (causing the reconciler to bail on "structural mismatch" and silently skip auto-formatting)Context
Discovered in
recipes-csharpwhereUseGuidCreateVersion7silently failed on 989 customer instances becauseMethodTypewas null. The recipe was fixed to useCSharpPattern, but the test gap (no default assemblies) masked the issue during development.Test plan
AutoFormatsTemplateResultIndentationwhich previously failed when type attribution was added (due to the reconciler bug)