From: Rodrigo Kumpera Date: Fri, 17 May 2013 15:03:25 +0000 (-0400) Subject: Add regression test for #11362. X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=e5c45f1161604733b116a0a83782c08f74fb3127;p=mono.git Add regression test for #11362. --- diff --git a/mono/tests/load-exceptions.cs b/mono/tests/load-exceptions.cs index 0c3f5146766..cb2fc098375 100644 --- a/mono/tests/load-exceptions.cs +++ b/mono/tests/load-exceptions.cs @@ -325,6 +325,21 @@ public class Tests : LoadMissing { return 0; } + public static int test_0_reflection_on_field_with_missing_type () { + var t = typeof (BadOverridesDriver).Assembly.GetType ("FieldWithMissingType"); + foreach (var f in t.GetFields (BindingFlags.Public | BindingFlags.Static)) { + try { + Console.WriteLine (f.Name); + f.GetValue (null); + return 1; + } catch (TypeLoadException) { + return 0; + } + } + return 2; + } + + public static int Main () { return TestDriver.RunTests (typeof (Tests)); } diff --git a/mono/tests/load-missing.il b/mono/tests/load-missing.il index f85fea80e95..dfdf0b2bc8d 100644 --- a/mono/tests/load-missing.il +++ b/mono/tests/load-missing.il @@ -719,3 +719,9 @@ ret } } + +.class public auto ansi beforefieldinit FieldWithMissingType +{ + .field public [T]Missing BrokenField + .field public static int32 WorkingField +}