Merge pull request #409 from Alkarex/patch-1
[mono.git] / mcs / mcs / reflection.cs
index 6f2f183a83b97ef251bdabdaba13838bff6956da..411416712ad368e275b30ec310760b553b0b872f 100644 (file)
@@ -83,7 +83,7 @@ namespace Mono.CSharp
                {
                        // It can be used more than once when importing same assembly
                        // into 2 or more global aliases
-                       var definition = GetAssemblyDefinition (assembly);
+               GetAssemblyDefinition (assembly);
 
                        //
                        // This part tries to simulate loading of top-level
@@ -98,7 +98,7 @@ namespace Mono.CSharp
                                all_types = e.Types;
                        }
 
-                       ImportTypes (all_types, targetNamespace, definition.HasExtensionMethod);
+                       ImportTypes (all_types, targetNamespace, true);
                }
 
                public ImportedModuleDefinition ImportModule (Module module, RootNamespace targetNamespace)
@@ -166,8 +166,11 @@ namespace Mono.CSharp
        {
                [System.Runtime.InteropServices.FieldOffset (0)]
                int i;
+
+#pragma warning disable 414
                [System.Runtime.InteropServices.FieldOffset (0)]
                float f;
+#pragma warning restore 414
 
                public static int SingleToInt32Bits (float v)
                {
@@ -442,12 +445,7 @@ namespace Mono.CSharp
                        return assembly.GetType (compiler.BuiltinTypes.Object.FullName) != null;
                }
 
-               public override Assembly LoadAssemblyFile (string fileName)
-               {
-                       return LoadAssemblyFile (fileName, false);
-               }
-
-               Assembly LoadAssemblyFile (string assembly, bool soft)
+               public override Assembly LoadAssemblyFile (string assembly, bool isImplicitReference)
                {
                        Assembly a = null;
 
@@ -464,7 +462,7 @@ namespace Mono.CSharp
                                                a = Assembly.Load (ass);
                                        }
                                } catch (FileNotFoundException) {
-                                       bool err = !soft;
+                                       bool err = !isImplicitReference;
                                        foreach (string dir in paths) {
                                                string full_path = Path.Combine (dir, assembly);
                                                if (!assembly.EndsWith (".dll") && !assembly.EndsWith (".exe"))
@@ -490,11 +488,6 @@ namespace Mono.CSharp
                        return a;
                }
 
-               public override Assembly LoadAssemblyDefault (string fileName)
-               {
-                       return LoadAssemblyFile (fileName, true);
-               }
-
                Module LoadModuleFile (AssemblyDefinitionDynamic assembly, string module)
                {
                        string total_log = "";
@@ -554,4 +547,4 @@ namespace Mono.CSharp
                        }
                }
        }
-}
\ No newline at end of file
+}