You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit eedb9df
Browse filesBrowse the repository at this point in the historyBrowse files
committed
Consolidate STJ polymorphism tests into a shared abstract suite (#129755)
Test-only refactoring to expand test coverage ahead of #129041 being
implemented.
Moves `PolymorphicTests.CustomTypeHierarchies.cs` and
`PolymorphicTests.TypeClassifier.cs` from
`System.Text.Json.Tests/Serialization/` into `tests/Common/` so they run
under both reflection (11 wrappers) and source-gen (4 wrappers) via the
`SerializerWrapper` pattern, removes the duplicate
`PolymorphismTests.cs` in the source-gen test project, and wires the
consolidated suite through a new context file under
`System.Text.Json.SourceGeneration.Tests/Serialization/PolymorphicTests.cs`.
The test-only nature should make this straightforward to review.
---------
Co-authored-by: eiriktsarpalis <eiriktsarpalis@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
thrownewSkipTestException("Source generator rejects this invalid polymorphic configuration at build time (SYSLIB diagnostic); the runtime InvalidOperationException is validated under reflection only.");
thrownewSkipTestException("Source generator rejects this invalid polymorphic configuration at build time (SYSLIB diagnostic); the runtime InvalidOperationException is validated under reflection only.");
thrownewSkipTestException("Source generator rejects this invalid polymorphic configuration at build time (SYSLIB diagnostic); the runtime InvalidOperationException is validated under reflection only.");
2884
+
}
2885
+
2861
2886
// Derived<T> : Base<int> - T cannot be determined from Base<int>
thrownewSkipTestException("Source generator rejects this invalid polymorphic configuration at build time (SYSLIB diagnostic); the runtime InvalidOperationException is validated under reflection only.");
thrownewSkipTestException("Source generator rejects this invalid polymorphic configuration at build time (SYSLIB diagnostic); the runtime InvalidOperationException is validated under reflection only.");
3213
+
}
3214
+
3180
3215
// Impl<T> : IBase<T>, IBase<List<T>> registered on IBase<List<int>>.
3181
3216
// Both ancestors unify (T=List<int> via the first interface, T=int via the second).
3182
3217
// Result: ambiguous, throws.
@@ -3189,9 +3224,14 @@ public interface IOpenGenericBase_Ambiguous<T>;
thrownewSkipTestException("Source generator rejects this invalid polymorphic configuration at build time (SYSLIB diagnostic); the runtime InvalidOperationException is validated under reflection only.");
3233
+
}
3234
+
3195
3235
// Derived<T1, T2> : Base<T1> — T2 is unspeakable (not bound by the base type's args).
thrownewSkipTestException("Source generator rejects this invalid polymorphic configuration at build time (SYSLIB diagnostic); the runtime InvalidOperationException is validated under reflection only.");
3251
+
}
3252
+
3208
3253
// Derived<T> : Base<T> where T : struct, registered on Base<string>.
thrownewSkipTestException("Source generator rejects this invalid polymorphic configuration at build time (SYSLIB diagnostic); the runtime InvalidOperationException is validated under reflection only.");
0 commit comments