Deal with missing nested type as well
authorMarek Safar <marek.safar@gmail.com>
Wed, 12 Jan 2011 15:21:02 +0000 (15:21 +0000)
committerMarek Safar <marek.safar@gmail.com>
Wed, 12 Jan 2011 15:32:01 +0000 (15:32 +0000)
mcs/class/IKVM.Reflection/Type.cs
mcs/errors/CS0012-11-lib.il [new file with mode: 0644]
mcs/errors/cs0012-11.cs [new file with mode: 0644]
mcs/mcs/ikvm.cs

index 43ed271e37011fa04b086518dcc1edba7bf408db..306794347e530d1b7af60dfb637da8b26aa642ed 100644 (file)
@@ -741,7 +741,7 @@ namespace IKVM.Reflection
                        return GetNestedType(name, BindingFlags.Public);
                }
 
                        return GetNestedType(name, BindingFlags.Public);
                }
 
-               public Type GetNestedType(string name, BindingFlags bindingAttr)
+               public virtual Type GetNestedType(string name, BindingFlags bindingAttr)
                {
                        foreach (Type type in GetNestedTypes(bindingAttr))
                        {
                {
                        foreach (Type type in GetNestedTypes(bindingAttr))
                        {
diff --git a/mcs/errors/CS0012-11-lib.il b/mcs/errors/CS0012-11-lib.il
new file mode 100644 (file)
index 0000000..75fab2f
--- /dev/null
@@ -0,0 +1,34 @@
+.assembly extern mscorlib
+{
+}
+
+.assembly extern 'CS0012-lib-missing'
+{
+}
+
+.assembly 'CS0012-11-lib'
+{
+  .hash algorithm 0x00008004
+  .ver 0:0:0:0
+}
+
+.module 'CS0012-11-lib.dll'
+
+.class public auto ansi beforefieldinit B
+       extends [mscorlib]System.Object
+{
+  .method public hidebysig instance class ['CS0012-lib-missing']A/Nested
+          Test() cil managed
+  {
+    IL_0000:  ret
+  }
+
+  .method public hidebysig specialname rtspecialname 
+          instance void  .ctor() cil managed
+  {
+    IL_0000:  ldarg.0
+    IL_0001:  call       instance void [mscorlib]System.Object::.ctor()
+    IL_0006:  ret
+  }
+
+}
diff --git a/mcs/errors/cs0012-11.cs b/mcs/errors/cs0012-11.cs
new file mode 100644 (file)
index 0000000..f1a40c8
--- /dev/null
@@ -0,0 +1,11 @@
+// CS0012: The type `I1' is defined in an assembly that is not referenced. Consider adding a reference to assembly `CS0012-lib-missing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
+// Line: 10
+// Compiler options: -r:CS0012-5-lib.dll
+
+class Test
+{
+       public static void Main ()
+       {
+               new B ().Test ();
+       }
+}
\ No newline at end of file
index d549b8f2794df27b8589a0dd9ea678aa15a5f350..7cf9a39b7c0b4062517b98125b37c0b7bcff6fee 100644 (file)
@@ -611,6 +611,11 @@ namespace Mono.CSharp
                        return new MissingType ("#" + index.ToString (), assembly);
                }
 
                        return new MissingType ("#" + index.ToString (), assembly);
                }
 
+               public override MetaType GetNestedType (string name, BindingFlags bindingAttr)
+               {
+                       return new MissingType (full_name + name, assembly);
+               }
+
                public override bool IsGenericTypeDefinition {
                        get {
                                return full_name.IndexOf ('`') > 0;
                public override bool IsGenericTypeDefinition {
                        get {
                                return full_name.IndexOf ('`') > 0;