2004-09-07 Miguel de Icaza <miguel@ximian.com>
- * expression.cs: Return false if we fail to resolve the inner
- expression.
+ * literal.cs: The type of the null-literal is the null type; So
+ we use a placeholder type (literal.cs:System.Null, defined here)
+ for it.
+
+ * expression.cs (Conditional.DoResolve): Remove some old code that
+ is no longer needed, conversions have been fixed.
+
+ (ArrayCreationExpression.DoResolve): Return false if we fail to
+ resolve the inner expression.
2004-09-07 Raja R Harinath <rharinath@novell.com>
Type true_type = trueExpr.Type;
Type false_type = falseExpr.Type;
- if (trueExpr is NullLiteral){
- type = false_type;
- return this;
- } else if (falseExpr is NullLiteral){
- type = true_type;
- return this;
- }
-
//
// First, if an implicit conversion exists from trueExpr
// to falseExpr, then the result type is of type falseExpr.Type
using System.Reflection;
using System.Reflection.Emit;
+//
+// I put System.Null just so we do not have to special case it on
+// TypeManager.CSharpName
+//
+namespace System {
+ //
+ // Represents the Null Type, just used as a placeholder for the type in NullLiteral
+ //
+ public class Null {
+ }
+}
+
namespace Mono.CSharp {
public class NullLiteral : Constant {
public override Expression DoResolve (EmitContext ec)
{
- type = TypeManager.object_type;
+ type = typeof (System.Null);
return this;
}
@"^System\." +
@"(Int32|UInt32|Int16|UInt16|Int64|UInt64|" +
@"Single|Double|Char|Decimal|Byte|SByte|Object|" +
- @"Boolean|String|Void)" +
+ @"Boolean|String|Void|Null)" +
@"(\W+|\b)",
new MatchEvaluator (CSharpNameMatch));
}