2001-10-12 Ravi Pratap <ravi@ximian.com>
[mono.git] / mcs / mcs / assign.cs
index 22562d98c7e77deeb85ab08d490e8739879e5601..36081efe19fa5bf07bf9e464354075ccedf5a1a4 100755 (executable)
@@ -42,10 +42,10 @@ namespace CIR {
                        }
                }
 
-               public override Expression Resolve (TypeContainer tc)
+               public override Expression DoResolve (EmitContext ec)
                {
-                       target = target.Resolve (tc);
-                       source = source.Resolve (tc);
+                       target = target.Resolve (ec);
+                       source = source.Resolve (ec);
 
                        if (target == null || source == null)
                                return null;
@@ -55,15 +55,16 @@ namespace CIR {
                        Type source_type = source.Type;
 
                        if (target_type != source_type){
-                               source = ConvertImplicitRequired (tc, source, target_type, l);
+                               source = ConvertImplicitRequired (ec, source, target_type, l);
                                if (source == null)
                                        return null;
                        }
                        
                        if (!(target is LValue)){
-                               tc.RootContext.Report.Error (131, "Left hand of an assignment must be a variable, a property or an indexer");
+                               Report.Error (131, "Left hand of an assignment must be a variable, a property or an indexer");
                        }
                        type = target_type;
+                       eclass = ExprClass.Value;
                        return this;
                }
 
@@ -88,7 +89,7 @@ namespace CIR {
                                if (!is_statement)
                                        ig.Emit (OpCodes.Dup);
 
-                               ((LValue) target).Store (ig);
+                               ((LValue) target).Store (ec);
                        } else if (target.ExprClass == ExprClass.PropertyAccess){
                                // FIXME
                                throw new Exception ("Can not assign to properties yet");