X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Fgenerics.2.cs;h=46df57531d3115802073241a1d208d0d0844f96b;hb=dba1e96418a00b863db3565d5997314105bd8aa3;hp=57ebdfdd9b4f9205598eb6399b08a49d965a7002;hpb=64f85a65b023522d3f34e9932e6a843e0ad8fc3b;p=mono.git diff --git a/mono/mini/generics.2.cs b/mono/mini/generics.2.cs index 57ebdfdd9b4..46df57531d3 100644 --- a/mono/mini/generics.2.cs +++ b/mono/mini/generics.2.cs @@ -156,6 +156,47 @@ class Tests { return 0; } + public static int test_0_box_brtrue_opt () { + Foo f = new Foo (5); + + f [123] = 5; + + return 0; + } + + public static int test_0_box_brtrue_opt_regress_81102 () { + if (new Foo(5).ToString () == "null") + return 0; + else + return 1; + } + + public class Foo + { + public Foo(T1 t1) + { + m_t1 = t1; + } + + public override string ToString() + { + return Bar(m_t1 == null ? "null" : "null"); + } + + public String Bar (String s) { + return s; + } + + public int this [T1 key] { + set { + if (key == null) + throw new ArgumentNullException ("key"); + } + } + + readonly T1 m_t1; + } + public interface IMyHandler { object Bar(); }