We should not return "default" if there's a private parameterless constructor. GetDefaultConstructor only calls the default constructor in the C# sense (public parameterless ctor on a non-abstract class).
&& method.Name == "CreateInstance")
{
TypeDesc type = method.Instantiation[0];
- if (type.IsValueType && type.GetDefaultConstructor() == null)
+ if (type.IsValueType && type.GetParameterlessConstructor() == null)
{
// Replace the body with implementation that just returns "default"
MethodDesc createDefaultInstance = method.OwningType.GetKnownMethod("CreateDefaultInstance", method.GetTypicalMethodDefinition().Signature);