Repository navigation
Preserve generic tuple rows from instance data sources #7548
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
Changes from all commits
82bebed
68028a5
330e157
d8a8d8a
0285bc3
4e9a831
d5ab6c1
6843efe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,7 +26,7 @@ | |
| private const string InstanceMethodDataSourceAttributeName = "global::TUnit.Core.InstanceMethodDataSourceAttribute"; | ||
|
|
||
| private static readonly DiagnosticDescriptor GenerationErrorDescriptor = new( | ||
| "TUNIT0999", | ||
|
Check warning on line 29 in src/TUnit.Core.SourceGenerator/Generators/TestMetadataGenerator.cs
|
||
| "Source Generation Error", | ||
| "Failed to generate test metadata for {0}.{1}: {2}", | ||
| "TUnit", | ||
|
|
@@ -4516,9 +4516,10 @@ | |
| { | ||
| writer.AppendLine("// Special handling for single tuple parameter"); | ||
| // Factories preserve one-element tuple rows, so a matching tuple is the whole row, | ||
| // even when its element is another tuple of the same type. | ||
| // even when its element is another tuple of the same type. Incompatible singleton | ||
| // containers also need element-wise conversion through the wrapped-row path. | ||
| var unwrappedCheck = singleTupleParam.TupleElements.Length == 1 | ||
| ? $" && args[0] is not {singleTupleParam.GloballyQualified()}" | ||
| ? " && args[0] is not global::System.Runtime.CompilerServices.ITuple { Length: 1 }" | ||
| : ""; | ||
| writer.AppendLine($"if (args.Length == {singleTupleParam.TupleElements.Length.ToString(CultureInfo.InvariantCulture)}{unwrappedCheck})"); | ||
| writer.AppendLine("{"); | ||
|
|
@@ -7699,7 +7700,7 @@ | |
| { | ||
| if (!inferredTypes.ContainsKey(name)) | ||
| { | ||
| inferredTypes[name] = compilation.GetSpecialType(SpecialType.System_Object); | ||
|
Check warning on line 7703 in src/TUnit.Core.SourceGenerator/Generators/TestMetadataGenerator.cs
|
||
| } | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.