https://bugzilla.novell.com/show_bug.cgi?id=336936

           Summary: Type.InvokeMember should throw ArgumentException when no
                    operation is specified in bindingflags
           Product: Mono: Class Libraries
           Version: 1.2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [EMAIL PROTECTED]
          Found By: ---


When the bindingflags specified in Type.InvokeMember do not contain any of the
following flags then an ArgumentException must be thrown:

To reproduce, compile and run the following code snippet:

using System;
using System.Reflection;

class Program
{
        private const BindingFlags DefaultBindingFlags = BindingFlags.Public |
                BindingFlags.Static;

        static void Main ()
        {
                Type type = typeof (Program);
                type.InvokeMember ("Run", DefaultBindingFlags,
                null, null, new object [0]);
        }

        static void Run ()
        {
        }
}

Expected result:

Unhandled Exception: System.ArgumentException: Must specify binding flags
descri
bing the invoke operation required (BindingFlags.InvokeMethod CreateInstance
Get
Field SetField GetProperty SetProperty).
Parameter name: bindingFlags
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags,
Bi
nder binder, Object target, Object[] providedArgs, ParameterModifier[]
modifiers
, CultureInfo culture, String[] namedParams)
   at Program.Main()

Actual result:

Member is not invoked, but no ArgumentException is thrown.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to