roslyn
roslyn copied to clipboard
Emit and report missing `Decimal-` and `DateTimeConstantAttribute`
Fixes #65728.
- Emits those attributes for synthesized delegates and closure implementation methods.
- Reports if those attribute types are missing (instead of crashing on
Debug.Assert
during emit) for synthesized delegates, methods, local functions, lambdas, and fields.
Relates to lambda default parameters.
Done with review pass (commit 2)
Done with review pass (commit 14)
// check that the corresponding `*ConstantAttribute` is available.
It is not clear to me why this check was relevant here and isn't relevant any more. It feels to me that checking for System_ParamArrayAttribute__ctor and for these attributes should always come together.
In reply to: 1353581343
In reply to: 1353581343
Refers to: src/Compilers/CSharp/Portable/Binder/Semantics/Conversions/Conversions.cs:72 in ebf1101. [](commit_id = ebf11012711cc15756843eb014d271b6ba52b971, deletion_comment = True)
Done with review pass (commit 40)
Done with review pass (commit 46)
if (isSynthesized && defaultValue != ConstantValue.NotAvailable &&
Dropped the != ConstantValue.NotAvailable
check. Doesn't look intentional. #Closed
Refers to: src/Compilers/CSharp/Portable/Binder/Binder_Conversions.cs:793 in 589ff29. [](commit_id = 589ff29cd98b87c45a20c28eb312477125886c02, deletion_comment = True)
if (isSynthesized && defaultValue != ConstantValue.NotAvailable &&
I see, that was equivalent to the null check
In reply to: 1358063599
Refers to: src/Compilers/CSharp/Portable/Binder/Binder_Conversions.cs:793 in 589ff29. [](commit_id = 589ff29cd98b87c45a20c28eb312477125886c02, deletion_comment = True)
@dotnet/roslyn-compiler for the second review