Skip to content

CS7003 is only reported during build and doesn't appear on the IDE #80419

@Rekkonnect

Description

@Rekkonnect

Version Used:
Visual Studio 2026 (18.0.0 Insiders [11012.119])
Roslyn 5.0.0-2.25459.9 @ 5d47bb1

Details:

The error CS7003 "Unexpected use of an unbound generic name" is not reported before the project is built, and the IDE will not display the error squiggles

Example:

https://sharplab.io/#v2:CYLg1APgAgzABFATHAwgWAFAG9Nz3ABwCcBLANwEMAXAUwQEYA2OYATwDsKBbEgYzgAiHbnwCyNKgAsA9sAAUbTj34l2BAK5UAlLnw4M+QwgDscVRqoA6AMrSuEyaoDmAHgB8crQG16AXQDcungAvkFwYbAMzFD0AAxwtvZSzp5h+kb4UKYxsZYAolwEVKyBBvihGBVAA===

public class C
{
    private static dynamic DynamicMethod(dynamic input)
    {
        return input.Something<>()[1];
    }
    
    public static string Something()
    {
        return string.Empty;
    }
}

Screenshot

Image

Expected Behavior:
The error is reported and shown with squiggles in the IDE like every other error

Actual Behavior:
The diagnostic is only emitted during build and is not visible in the IDE

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions