Another small fix, don't crash here.
[mono.git] / mcs / gmcs / report.cs
index 3e1721bba47524f4233f59512b00a06719987a59..b733bb53edcf6c3f544b90e1935f37adbaa6c5af 100644 (file)
@@ -257,7 +257,7 @@ namespace Mono.CSharp {
         
                static public void RuntimeMissingSupport (string feature) 
                {
-                       Report.Error (-88, "Your .NET Runtime does not support '{0}'. Please use the latest Mono runtime instead.");
+                       Report.Error (-88, "Your .NET Runtime does not support '{0}'. Please use the latest Mono runtime instead.", feature);
                }
 
                /// <summary>
@@ -271,12 +271,15 @@ namespace Mono.CSharp {
 
                static public void SymbolRelatedToPreviousError (MemberInfo mi)
                {
-                       TypeContainer temp_ds = TypeManager.LookupTypeContainer (mi.DeclaringType);
+                       TypeContainer temp_ds = TypeManager.LookupGenericTypeContainer (mi.DeclaringType);
                        if (temp_ds == null) {
                                SymbolRelatedToPreviousError (mi.DeclaringType.Assembly.Location, TypeManager.GetFullNameSignature (mi));
                        } else {
-                               if (mi is MethodBase) {
-                                       IMethodData md = TypeManager.GetMethod ((MethodBase)mi);
+                               MethodBase mb = mi as MethodBase;
+                               if (mb != null) {
+                                       if (mb.Mono_IsInflatedMethod)
+                                               mb = mb.GetGenericMethodDefinition ();
+                                       IMethodData md = TypeManager.GetMethod (mb);
                                        SymbolRelatedToPreviousError (md.Location, md.GetSignatureForError (temp_ds));
                                        return;
                                }