提交 20f08e15 编写于 作者: M Marek Safar

[659022] Resolve reduced expressions

上级 0dcc87e5
......@@ -1118,7 +1118,7 @@ namespace Mono.CSharp.Nullable
// Reduce (left ?? null) to left OR (null-constant ?? right) to right
//
if (right.IsNull || lc != null)
return ReducedExpression.Create (lc != null ? right : left, this);
return ReducedExpression.Create (lc != null ? right : left, this).Resolve (ec);
right = Convert.ImplicitConversion (ec, right, ltype, loc);
type = ltype;
......@@ -1136,7 +1136,7 @@ namespace Mono.CSharp.Nullable
// Reduce (null ?? right) to right
//
if (left.IsNull)
return ReducedExpression.Create (right, this);
return ReducedExpression.Create (right, this).Resolve (ec);
left = Convert.ImplicitConversion (ec, unwrap != null ? unwrap : left, rtype, loc);
type = rtype;
......
using System;
public static class Program
{
private static void Main ()
{
Exception ex1 = null ?? new Exception ();
Exception ex2 = new Exception() ?? null;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册