[Mono-bugs] [Bug 399985] New: Exception on PropertyInfo. SetValue on a enumeration-typed property
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Fri Jun 13 06:08:52 EDT 2008
https://bugzilla.novell.com/show_bug.cgi?id=399985
Summary: Exception on PropertyInfo.SetValue on a enumeration-
typed property
Product: Mono: Runtime
Version: 1.9.0
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: misc
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: jp.gouigoux at free.fr
QAContact: mono-bugs at lists.ximian.com
Found By: DeveloperNet
Under Windows / MS CLR, the following code returns OK twice.
Under Linux / Mono 1.9, we get OK for the first test, and an exception for the
second one.
using System;
using System.Reflection;
namespace TestBug
{
class Program
{
class ClasseTest
{
public enum Mode { SANS, AVEC, PEUTETRE };
private Mode Valeur = 0;
public Mode Prop
{
get { return Valeur; }
set { Valeur = value; }
}
}
static void Main(string[] args)
{
Type TypeRef = typeof(ClasseTest);
ClasseTest Instance = new ClasseTest();
PropertyInfo Prop = TypeRef.GetProperty("Prop");
try
{
Prop.SetValue(Instance, ClasseTest.Mode.PEUTETRE, null);
Console.WriteLine("OK");
}
catch { Console.WriteLine("PROBLEM"); }
try
{
Prop.SetValue(Instance, 1, null);
Console.WriteLine("OK");
}
catch { Console.WriteLine("PROBLEM"); }
}
}
}
--
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