You've already forked linux-packaging-mono
Imported Upstream version 5.16.0.100
Former-commit-id: 38faa55fb9669e35e7d8448b15c25dc447f25767
This commit is contained in:
parent
0a9828183b
commit
7d7f676260
@ -95,13 +95,8 @@ namespace System.Reflection.Emit {
|
||||
public virtual void SetConstant (object defaultValue)
|
||||
{
|
||||
if (position > 0) {
|
||||
Type t = methodb.GetParameterType (position - 1);
|
||||
if (defaultValue != null && t != defaultValue.GetType ()) {
|
||||
if(!t.IsEnum || t.UnderlyingSystemType != defaultValue.GetType ())
|
||||
throw new ArgumentException ("Constant does not match the defined type.");
|
||||
}
|
||||
if (t.IsValueType && !t.IsPrimitive && !t.IsEnum && t != typeof (DateTime))
|
||||
throw new ArgumentException ("" + t + " is not a supported constant type.");
|
||||
TypeBuilder.SetConstantValue (methodb.GetParameterType (position - 1),
|
||||
defaultValue, ref defaultValue);
|
||||
}
|
||||
|
||||
def_value = defaultValue;
|
||||
|
Reference in New Issue
Block a user