* ecore.cs: Don't report NRE warning for lifted null.
svn path=/trunk/mcs/; revision=160014
+2010-07-07 Marek Safar <marek.safar@gmail.com>
+
+ * ecore.cs: Don't report NRE warning for lifted null.
+
2010-07-07 Marek Safar <marek.safar@gmail.com>
* typemanager.cs, convert.cs, expression.cs: Another reference
public virtual MemberExpr ResolveMemberAccess (ResolveContext ec, Expression left, SimpleName original)
{
- Constant c = left as Constant;
- if (c != null && c.GetValue () == null) {
+ if (left != null && left.IsNull && TypeManager.IsReferenceType (left.Type)) {
ec.Report.Warning (1720, 1, left.Location,
"Expression will always cause a `{0}'", "System.NullReferenceException");
}