Skip to content

Assignment of lambda to delegate fails for value type with generic NRT #47167

@sharwell

Description

@sharwell

Version Used: 3.8.0-2.20408.4

Steps to Reproduce:

delegate void D<T>(out T? value);
D<int> d = (out int v) => v = 0;

Expected Behavior:

No warnings.

Actual Behavior:

Warning CS8622: Nullability of reference types in type of parameter 'v' of 'lambda expression' doesn't match the target delegate D<int>'

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions