Thanks to Peter Sestoft for this bug report.
* expression.cs (Conditional): If both the `trueExpr' and the
`falseExpr' is a NullLiteral, return a NullLiteral.
svn path=/trunk/mcs/; revision=34237
+2004-09-22 Martin Baulig <martin@ximian.com>
+
+ Thanks to Peter Sestoft for this bug report.
+
+ * expression.cs (Conditional): If both the `trueExpr' and the
+ `falseExpr' is a NullLiteral, return a NullLiteral.
+
2004-09-22 Martin Baulig <martin@ximian.com>
* statement.cs (Foreach.EmitCollectionForeach): If we're in an
if (trueExpr == null || falseExpr == null)
return null;
+ if ((trueExpr is NullLiteral) && (falseExpr is NullLiteral))
+ return trueExpr;
+
eclass = ExprClass.Value;
if (trueExpr.Type == falseExpr.Type)
type = trueExpr.Type;
+2004-09-22 Martin Baulig <martin@ximian.com>
+
+ Thanks to Peter Sestoft for this bug report.
+
+ * expression.cs (Conditional): If both the `trueExpr' and the
+ `falseExpr' is a NullLiteral, return a NullLiteral.
+
2004-09-22 Martin Baulig <martin@ximian.com>
* statement.cs (Foreach.EmitCollectionForeach): If we're in an
if (trueExpr == null || falseExpr == null)
return null;
+ if ((trueExpr is NullLiteral) && (falseExpr is NullLiteral))
+ return trueExpr;
+
eclass = ExprClass.Value;
if (trueExpr.Type == falseExpr.Type)
type = trueExpr.Type;