Reflection.Emit: Allow `ParameterBuilder.SetConstant(null)` for value-typed parameter...
authorstakx <stakx@eml.cc>
Mon, 7 May 2018 14:15:49 +0000 (16:15 +0200)
committerAtsushi Kanamori <AtsushiKan@users.noreply.github.com>
Mon, 7 May 2018 14:15:49 +0000 (07:15 -0700)
commitfceac03e8202fb07dc1bb3b4f3ec3cf0921e12de
treef7c908d56fbfa1f34df16674853c1f8f8048b9bc
parenta8c1c328068518444775e7bb9211f07523c2f21b
Reflection.Emit: Allow `ParameterBuilder.SetConstant(null)` for value-typed parameters (#17887)

* Add test for dotnet/corefx#26184

The Roslyn C# compiler encodes an optional, value-typed parameter's
default value of `default(TValueType)` as a null reference constant in
metadata. Add a test that verifies that reflection can do the same
using `ParameterBuilder.SetConstant(null)`.

* Always allow ParameterBuilder.SetConstant(null)

* Remove test project as requested in review

These tests move to CoreFX. See dotnet/corefx#29532.
src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs