[Mono-bugs] [Bug 324242] Selects wrong overload for method containing System. Enum argument

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Nov 5 12:34:12 EST 2007


https://bugzilla.novell.com/show_bug.cgi?id=324242#c4





--- Comment #4 from Jerome Haltom <wasabi at larvalstage.net>  2007-11-05 10:34:11 MST ---
Oh. I take that back! I just stumbled onto the issue.

The problem is that achAccount.Type is a Nullable<SomeEnum>. The compiler does
not realize that that is castable to Enum. Test case is now simple:

using System;

enum TestEnum
{
  Val1 = 1,
}

class TestThing
{
  public void SetEnum(string a, Enum b)
  {
    Console.WriteLine("!");
  }
  public void SetEnum(int a, Enum b)
  {
    Console.WriteLine("!");
  }
}

class Test
{
  public static void Main(string[] args)
  {
    TestEnum? e = TestEnum.Val1;
    TestThing t = new TestThing();
    t.SetEnum("hi", e);
  }
}


-- 
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.


More information about the mono-bugs mailing list