}
}
+ public override Location StartLocation {
+ get {
+ return target.StartLocation;
+ }
+ }
+
public override bool ContainsEmitWithAwait ()
{
return target.ContainsEmitWithAwait () || source.ContainsEmitWithAwait ();
// Keep resolved value because field initializers have their own rules
//
ExpressionStatement resolved;
- IMemberContext mc;
+ FieldBase mc;
public FieldInitializer (FieldBase mc, Expression expression, Location loc)
: base (new FieldExpr (mc.Spec, expression.Location), expression, loc)
((FieldExpr)target).InstanceExpression = new CompilerGeneratedThis (mc.CurrentType, expression.Location);
}
+ public override Location StartLocation {
+ get {
+ return loc;
+ }
+ }
+
protected override Expression DoResolve (ResolveContext ec)
{
// Field initializer can be resolved (fail) many times
// Otherwise, if the selected operator is a predefined operator
//
Binary b = source as Binary;
- if (b == null && source is ReducedExpression)
- b = ((ReducedExpression) source).OriginalExpression as Binary;
+ if (b == null) {
+ if (source is ReducedExpression)
+ b = ((ReducedExpression) source).OriginalExpression as Binary;
+ else if (source is ReducedExpression.ReducedConstantExpression) {
+ b = ((ReducedExpression.ReducedConstantExpression) source).OriginalExpression as Binary;
+ } else if (source is Nullable.LiftedBinaryOperator) {
+ var po = ((Nullable.LiftedBinaryOperator) source);
+ if (po.UserOperator == null)
+ b = po.Binary;
+ } else if (source is TypeCast) {
+ b = ((TypeCast) source).Child as Binary;
+ }
+ }
if (b != null) {
//