Assert failures handling DynamicObjectCreationExpression in GetValEscape() and CheckValEscape()
#67.518 aperta il 28 mar 2023
Metriche repository
- Star
- (20.414 star)
- Metriche merge PR
- (Merge medio 6g 17h) (256 PR mergiate in 30 g)
Descrizione
Version Used: release/dev17.4: https://github.com/dotnet/roslyn/commit/528676cdbf0bfcfdb9372dc57a047dd0edc6d4db main: https://github.com/dotnet/roslyn/commit/3dee0a96cd8b5478390c47ddb0545875bf6b4c18
Steps to Reproduce:
Compile with DEBUG build:
static class Program
{
static void Main()
{
dynamic d = 0;
R x = new R(d);
R y;
y = new R(default(R), d);
}
}
readonly ref struct R
{
public R(int i) { }
public R(R r, int i) { }
}
Expected Behavior: (8,19): error CS1978: Cannot use an expression of type 'R' as an argument to a dynamically dispatched operation.
Actual Behavior:
Assert failures with message "DynamicObjectCreationExpression expression of R type" in GetValEscape() and CheckValEscape().
(8,19): error CS1978: Cannot use an expression of type 'R' as an argument to a dynamically dispatched operation. (8,13): error CS8751: Internal error in the C# compiler.