Skip to content

Commit

Permalink
Remove the extra diagnostic we emit when the compiler failed to parse…
Browse files Browse the repository at this point in the history
… the attribute. The C# compiler will already fail so just let it emit its diagnostics.


Fixes #69827
  • Loading branch information
jkoritzinsky authored May 25, 2022
1 parent 032a7dc commit 2b382d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ private static IncrementalStubGenerationContext CalculateStubInformation(

if (libraryImportData is null)
{
generatorDiagnostics.ReportConfigurationNotSupported(generatedDllImportAttr!, "Invalid syntax");
libraryImportData = new LibraryImportData("INVALID_CSHARP_SYNTAX");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ public static IEnumerable<object[]> CodeSnippetsToCompile_InvalidCode()
{
yield return new object[] { CodeSnippets.RecursiveImplicitlyBlittableStruct, 0, 1 };
yield return new object[] { CodeSnippets.MutuallyRecursiveImplicitlyBlittableStruct, 0, 2 };
yield return new object[] { CodeSnippets.PartialPropertyName, 1, 2 };
yield return new object[] { CodeSnippets.InvalidConstantForModuleName, 1, 1 };
yield return new object[] { CodeSnippets.IncorrectAttributeFieldType, 1, 1 };
yield return new object[] { CodeSnippets.PartialPropertyName, 0, 2 };
yield return new object[] { CodeSnippets.InvalidConstantForModuleName, 0, 1 };
yield return new object[] { CodeSnippets.IncorrectAttributeFieldType, 0, 1 };
}

[Theory]
Expand Down

0 comments on commit 2b382d3

Please sign in to comment.