Thanks to visit codestin.com
Credit goes to github.com

Skip to content

EnC analyzer reports duplicate semantic diagnostics #36061

@tmat

Description

@tmat
  1. Debug the following console app
		static void Main(string[] args)
		{
		    int a = 10; // breakpoint here
		}
  1. Change the code to:
		static void Main(string[] args)
		{
		    int a = 132408290348290;
		}
  1. Press F10.

The error list contains duplicate semantic errors:

image

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions