Permalink
Browse files

2005-12-14 Miguel de Icaza <miguel@novell.com>

	* convert.cs (ExplicitConversionCore): Check the return value from
	ExplicitConversionCore which can return null on failure.  Fixes #76914

svn path=/trunk/mcs/; revision=54369
  • Loading branch information...
1 parent 75a5d62 commit 9112456e6a821383d9f9d2ed9c723ed92c1b37f6 @migueldeicaza migueldeicaza committed Dec 14, 2005
Showing with 34 additions and 3 deletions.
  1. +5 −0 mcs/gmcs/ChangeLog
  2. +6 −3 mcs/gmcs/convert.cs
  3. +4 −0 mcs/gmcs/driver.cs
  4. +18 −0 mcs/gmcs/generic.cs
  5. +1 −0 mcs/gmcs/rootcontext.cs
View
@@ -1,3 +1,8 @@
+2005-12-14 Miguel de Icaza <miguel@novell.com>
+
+ * convert.cs (ExplicitConversionCore): Check the return value from
+ ExplicitConversionCore which can return null on failure. Fixes #76914
+
2005-12-09 Raja R Harinath <rharinath@novell.com>
* anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
View
@@ -1836,7 +1836,7 @@ static Expression ExplicitReferenceConversion (Expression source, Type target_ty
/// type is expr.Type to `target_type'.
/// </summary>
static public Expression ExplicitConversionCore (EmitContext ec, Expression expr,
- Type target_type, Location loc)
+ Type target_type, Location loc)
{
Type expr_type = expr.Type;
@@ -1862,8 +1862,11 @@ static Expression ExplicitReferenceConversion (Expression source, Type target_ty
return new Nullable.LiftedConversion (
expr, target_type, false, true, loc).Resolve (ec);
- if (TypeManager.IsEnumType (target_type))
- return new EmptyCast (ExplicitConversionCore (ec, expr, TypeManager.EnumToUnderlying (target_type), loc), target_type);
+ if (TypeManager.IsEnumType (target_type)){
+ Expression ce = ExplicitConversionCore (ec, expr, TypeManager.EnumToUnderlying (target_type), loc);
+ if (ce != null)
+ return new EmptyCast (ce, target_type);
+ }
ne = ExplicitNumericConversion (expr, target_type);
if (ne != null)
View
@@ -854,6 +854,10 @@ static bool UnixParseOption (string arg, ref string [] args, ref int i)
Report.Warning (-29, 1, "Compatibility: Use -warnaserror: option instead of --werror");
Report.WarningsAreErrors = true;
return true;
+
+ case "--broken-cycles":
+ RootContext.BrokenCircularDeps = true;
+ return true;
case "--nowarn":
Report.Warning (-29, 1, "Compatibility: Use -nowarn instead of --nowarn");
View
@@ -2093,6 +2093,24 @@ public static bool IsEqual (Type a, Type b)
return true;
}
+ //
+ // This is to build with the broken circular dependencies between
+ // System and System.Configuration in the 2.x profile where we
+ // end up with a situation where:
+ //
+ // System on the second build is referencing the System.Configuration
+ // that has references to the first System build.
+ //
+ // Point in case: NameValueCollection built on the first pass, vs
+ // NameValueCollection build on the second one. The problem is that
+ // we need to override some methods sometimes, or we need to
+ //
+ if (RootContext.BrokenCircularDeps){
+ if (a.Name == b.Name && a.Namespace == b.Namespace){
+ Console.WriteLine ("GonziMatch: {0}.{1}", a.Namespace, a.Name);
+ return true;
+ }
+ }
return false;
}
@@ -85,6 +85,7 @@ public class RootContext {
public static string StrongNameKeyContainer;
public static bool StrongNameDelaySign;
+ public static bool BrokenCircularDeps;
//
// If set, enable XML documentation generation
//

0 comments on commit 9112456

Please sign in to comment.