static bool IsConvertiblePrimitive (Type type)
{
var t = type.GetNotNullableType ();
-
+
if (t == typeof (bool))
return false;
if (type.IsInterface || target.IsInterface)
return true;
+ if (type.IsEnum && target == typeof (Enum))
+ return true;
+
if (type.IsValueType || target.IsValueType)
return false;
throw new ArgumentNullException ("addMethod");
if (arguments == null)
throw new ArgumentNullException ("arguments");
- if (addMethod.Name.ToLower (CultureInfo.InvariantCulture) != "add")
+ if (addMethod.Name.ToLowerInvariant () != "add")
throw new ArgumentException ("addMethod");
if (addMethod.IsStatic)
throw new ArgumentException ("addMethod must be an instance method", "addMethod");
var inits = CheckListInit (newExpression, initializers);
if (addMethod != null) {
- if (addMethod.Name.ToLower (CultureInfo.InvariantCulture) != "add")
+ if (addMethod.Name.ToLowerInvariant () != "add")
throw new ArgumentException ("addMethod");
var parameters = addMethod.GetParameters ();
// This method must be overwritten by derived classes to
// compile the expression
//
+#if !FULL_AOT_RUNTIME
internal virtual void Emit (EmitContext ec)
{
throw new NotImplementedException (String.Format ("Emit method is not implemented in expression type {0}", GetType ()));
}
+#endif
}
}