-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
- Debug the following console app
static void Main(string[] args)
{
int a = 10; // breakpoint here
}- Change the code to:
static void Main(string[] args)
{
int a = 132408290348290;
}- Press F10.
The error list contains duplicate semantic errors:
This is because the EnC analyzer reports all diagnostics returned by EmitDifference and some of them (syntactic and binding) have also been reported by the diagnostic analyzer. The solution would be to only report emit diagnostics from EnC. But the compiler currently does not tag diagnostics with the phase they originated from.
See also #1400 (comment) and #3675 (comment)
An alternative solution would be to call compilation.GetDiagnostics() and if there are any, do not attempt to emit and do not report any diagnostics (they were already reported by the diagnostic analyzer). However, this would significantly affect performance of applying the change. This operation is blocking - the customer can't continue debugging without changes applied, so doing as little work as possible is critical. The only diagnostics that need to block change application are those that prevent emitting the symbols affected by the change. Diagnostics on any other symbols can be ignored.