Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Error format
  • Loading branch information
Julien Couvreur committed Jul 6, 2023
commit bddcfb303a76e0da5089edd9fe0b47e57da7490c
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,19 @@ static DiagnosticInfo createObsoleteDiagnostic(Symbol symbol, BinderFlags locati
{
Debug.Assert(data.Message == null);
Debug.Assert(!data.IsError);
return new CSDiagnosticInfo(ErrorCode.WRN_Experimental, symbol);
// Provide an explicit format for fully-qualified type names.
return new CSDiagnosticInfo(ErrorCode.WRN_Experimental,
new FormattedSymbol(symbol, SymbolDisplayFormat.CSharpErrorMessageFormat));
}

if (data.Kind == ObsoleteAttributeKind.Experimental)
{
Debug.Assert(data.Message is null);
Debug.Assert(!data.IsError);

return new CustomObsoleteDiagnosticInfo(MessageProvider.Instance, (int)ErrorCode.WRN_Experimental, data, symbol);
// Provide an explicit format for fully-qualified type names.
return new CustomObsoleteDiagnosticInfo(MessageProvider.Instance, (int)ErrorCode.WRN_Experimental, data,
new FormattedSymbol(symbol, SymbolDisplayFormat.CSharpErrorMessageFormat));
}

// Issue a specialized diagnostic for add methods of collection initializers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ public static void M() { }
""";
var comp = CreateCompilation(new[] { src, experimentalAttributeSrc });
comp.VerifyDiagnostics(
// 0.cs(1,1): warning DiagID1: 'C' is for evaluation purposes only and is subject to change or removal in future updates.
// 0.cs(1,1): warning DiagID1: 'N.C' is for evaluation purposes only and is subject to change or removal in future updates.
// N.C.M();
Diagnostic("DiagID1", "N.C").WithArguments("N.C").WithLocation(1, 1)
);
Copy link
Member

@jjonescz jjonescz Jun 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider verifying the Help URL is the default one here:

Assert.Equal(DefaultHelpLinkUri, diag.Descriptor.HelpLinkUri);
``` #Resolved

Expand Down