2005-06-30:2 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
authorRafael Teixeira <monoman@gmail.com>
Thu, 30 Jun 2005 19:08:52 +0000 (19:08 -0000)
committerRafael Teixeira <monoman@gmail.com>
Thu, 30 Jun 2005 19:08:52 +0000 (19:08 -0000)
*assign.cs: Killed exception occurring when resolving an assignment
to an undefined symbol (Explicit On scenario)

svn path=/trunk/mcs/; revision=46784

mcs/mbas/ChangeLog
mcs/mbas/assign.cs

index 7328794e4e69e7a281ce6adf3ee6feedc4f63291..f9ed764200bde510ff715b4618e7d59e732c4240 100644 (file)
@@ -1,3 +1,7 @@
+2005-06-30:2 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
+       *assign.cs: Killed exception occurring when resolving an assignment 
+       to an undefined symbol (Explicit On scenario)
+
 2005-06-30 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
        *mb-parser.jay: Eliminating 'reduce/reduce conflicts' and 'rule never reduced'
        by simplifying the directive_expression rule (formerly directive_exp).
index 7420431e55b492ce47fb17197a8875337f563c94..a711f2dddde467d3c4c9752885c70811c0b8a2d4 100644 (file)
@@ -230,7 +230,7 @@ namespace Mono.MonoBASIC {
                        if (embedded != null)
                                source = (embedded.temp != null) ? embedded.temp : embedded.source;
                        //To support 'Mid' Assignment Statement
-                       if(target is Invocation) {
+                       if (target is Invocation) {
 
                                Invocation i = (Invocation) target;
                                Expression mid_expr;
@@ -291,26 +291,27 @@ namespace Mono.MonoBASIC {
 
                                arguments.Add (new Argument (source, Argument.AType.Expression));
 
-                               Expression etmp = lateBindingExpr;
-                               Type exprType = lateBindingExpr.Type;
-                               // Get the target of the invocation/memberAccess
-                               if (exprType == null) {
-                                       if (etmp is Invocation)
-                                               etmp = ((Invocation) etmp).Expr;
-                                       if (etmp is MemberAccess)
-                                               etmp = ((MemberAccess) etmp).Expr;
-                                       exprType = etmp.Type;
-                               }
+                               if (lateBindingExpr != null) {
+                                       Expression etmp = lateBindingExpr;
+                                       Type exprType = lateBindingExpr.Type;
+                                       // Get the target of the invocation/memberAccess
+                                       if (exprType == null) {
+                                               if (etmp is Invocation)
+                                                       etmp = ((Invocation) etmp).Expr;
+                                               if (etmp is MemberAccess)
+                                                       etmp = ((MemberAccess) etmp).Expr;
+                                               exprType = etmp.Type;
+                                       }
 
-                               if (exprType == TypeManager.object_type) {
-                                       StatementSequence tmp = new StatementSequence (ec.CurrentBlock, loc, lateBindingExpr, 
-                                                                               arguments, false, true);
-                                       if (!tmp.ResolveArguments (ec))
-                                               return null;
-                                       tmp.GenerateLateBindingStatements ();
-                                       return tmp.Resolve (ec);
+                                       if (exprType == TypeManager.object_type) {
+                                               StatementSequence tmp = new StatementSequence (ec.CurrentBlock, loc, lateBindingExpr, 
+                                                                                       arguments, false, true);
+                                               if (!tmp.ResolveArguments (ec))
+                                                       return null;
+                                               tmp.GenerateLateBindingStatements ();
+                                               return tmp.Resolve (ec);
+                                       }
                                }
-
                                return null;
                        }