GeezerVison is showing github.com — docs(mocks): explain emitted signature collision checks (#7302) · thomhurst/TUnit@f46bdb2
File tree
Expand file treeCollapse file tree
Open diff view settings
src/TUnit.Mocks.SourceGenerator/Builders
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/TUnit.Mocks.SourceGenerator/Builders/MockMembersBuilder.cs +5Lines changed: 5 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -939,6 +939,11 @@ internal static List<MockMemberModel> GetClosedReceiverGenericMethods(MockTypeMo |
939 | 939 | // Compare the actual emitted signatures, including predicate and params-expanded overloads. |
940 | 940 | // A closed substitution can collapse distinct open overloads; omit both rather than choosing |
941 | 941 | // which underlying member an identical setup should configure. |
| 942 | + // Model parameter types alone do not describe the generated matcher, predicate, expanded |
| 943 | + // params and framework-specific ref-struct overloads. Parse the emitter's output so this |
| 944 | + // check shares that signature definition instead of maintaining a second overload model. |
| 945 | + // Only same-name, same-arity overload groups need parsing; resolution stores the filtered |
| 946 | + // methods in the emission model so BuildMethodSetups does not repeat this analysis. |
942 | 947 | internal static List<MockMemberModel> GetClosedReceiverGenericMethods(MockTypeModel model, EquatableArray<string> typeArguments) |
943 | 948 | { |
944 | 949 | var methods = GetClosedReceiverGenericMethods(model); |
|